Comments (9)
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.
I would love this as a PR! Thank you so much for taking the time to look into this!
from ansible-role-samba.
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.
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.
This should be closed when #35 is merged.
from ansible-role-samba.
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.
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.
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.
cool! glad it works!
from ansible-role-samba.
Related Issues (20)
- Don't print passwords out to the log HOT 1
- Fout in ansible documentatie: samba_home(s)_include HOT 1
- adding users fails HOT 1
- Using include for other configurations doesn't work HOT 2
- use "map to guest = never" HOT 1
- Note that samba_mitigate_cve_2017_7494 disables share browsing HOT 1
- AIX Support / AIX PR / Thoughts/Concerns
- How to add special smb.conf setting.
- make no_log: true configurable HOT 1
- `libsemanage-python` not available on CentOS 8 HOT 1
- Fails if filesystem is EXFAT
- Do not create directories or set permissions HOT 1
- CVE-2017-7494 Mitigation is activated even if Samba version is newer then the affected one HOT 2
- Allow for changing the user password
- deleted
- No support for "allow hosts"
- Development HOT 4
- Wrong service names for Arch Linux HOT 1
- Does this role support `read_only` share option? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-samba.