Coder Social home page Coder Social logo

Comments (9)

goetzk avatar goetzk commented on July 18, 2024

As a suggestion (which seems like it might be a better way to go? I thought about using samba's include functionality instead (ignore the fruit options, they're something else I'm playing with)

Karls-MacBook-Air:bertvv.samba kgoetz$ git diff
diff --git a/templates/smb.conf.j2 b/templates/smb.conf.j2
index 27e8fa5..6634016 100755
--- a/templates/smb.conf.j2
+++ b/templates/smb.conf.j2
@@ -67,6 +67,10 @@
   nt pipe support = no
 {% endif %}
 
+{% if samba_global_include is defined %}
+  include = {{ samba_global_include }}
+{% endif %}
+
 {% if samba_load_homes %}
 ## Make home directories accessible
 [homes]
@@ -75,6 +79,10 @@
   writable = yes
 {% endif %}
 
+{% if samba_home_include is defined %}
+  include = {{ samba_home_include }}
+{% endif %}
+
 {% if samba_shares|length > 0 %}
 ## Shared directories
 {% for share in samba_shares %}
@@ -110,11 +118,18 @@
 {% endif %}
 {% if share.writable is defined %}
   writable = {{ share.writable }}
+{% endif %}
+{% if share.timemachine is defined %}
+  fruit:time machine = {{ share.timemachine }}
 {% endif %}
   create mode = {{ share.create_mode|default('0664') }}
   force create mode = {{ share.force_create_mode|default('0664') }}
   directory mode = {{ share.directory_mode|default('0775') }}
   force directory mode = {{ share.force_directory_mode|default('0775') }}
+{% if share.file_include is defined %}
+  include = {{ share.file_include }}
+{% endif %}
 
 {% endfor %}
 {% endif%}
+

Would you like me to do this up as a PR? It would need updated documentation but the conditionals are working already.

from ansible-role-samba.

bertvv avatar bertvv commented on July 18, 2024

I would love this as a PR! Thank you so much for taking the time to look into this!

from ansible-role-samba.

goetzk avatar goetzk commented on July 18, 2024

Quickly checking in to say I haven't forgotten this, I just haven't had time to complete the work yet!

from ansible-role-samba.

bertvv avatar bertvv commented on July 18, 2024

No problem, Karl! I have to admit that I'm often not able to fix issues and merge PRs in a timely manner myself. I appreciate that you are willing to take some time to implement this. Thank you!

from ansible-role-samba.

goetzk avatar goetzk commented on July 18, 2024

This should be closed when #35 is merged.

from ansible-role-samba.

goetzk avatar goetzk commented on July 18, 2024

hi @bertvv,

Have you had a chance to look at the open PRs? Anything else you'd like changed or reviewed in them?

from ansible-role-samba.

bertvv avatar bertvv commented on July 18, 2024

Sorry for the delay, @goetzk ! Working on it right now.

You may have seen the failing checks on all PRs. The cause was that my test environment was broken, at least for testing on Ubuntu 18.04. I needed some time to get that fixed first.
I'm adding your features in the test playbook and will release a new version as soon as that's done and all checks pass! One thing that my test environment cannot check is whether the TimeMachine share can actually be used as a backup target. I'm sure you'll let me know if it doesn't work, right? ;-)
Thank you so much for your great contributions!

from ansible-role-samba.

goetzk avatar goetzk commented on July 18, 2024

I'm currently backing up to it :) Its configured with the following section

  samba_shares:
      - name: TimeMachine
        comment: Backup target for Time Machines
        vfs_objects:
          # If missing these you'll see "The selected network backup disk does not support the required capabilities."
          - name: fruit
            options:
            - name: time machine
              value: 'yes'
            # - name: time machine max size
            #   value: 1T
          - name: streams_xattr
        path: /srv/timemachine
        write_list: timemachine
        owner: timemachine
        group: timemachine
        public: 'no'
        guest_ok: 'no'
        browseable: 'no'

I'm happy to post up my backup host playbook if it helps.

from ansible-role-samba.

bertvv avatar bertvv commented on July 18, 2024

cool! glad it works!

from ansible-role-samba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.