@installdoc/ansible-gas-station
Version:
An Ansible playbook that provisions your network with software from GitHub Awesome lists, developed with disaster recovery in mind ⛽🔥🤤
26 lines (23 loc) • 877 B
YAML
- name: Ensure smbd is started # noqa 301
command: launchctl load -w /System/Library/LaunchDaemons/com.apple.smbd.plist
- name: Check if 'samba_shares' directories exist
stat:
path: "{{ share.path | replace('/home/','/Users/') }}"
loop: "{{ samba_shares }}"
loop_control:
label: "{{ share.id }}"
loop_var: share
register: samba_shares_stat
- name: Configure SMB File sharing # noqa 305 503
shell: "sharing -a {{ share.path | replace('/home/','/Users/') }} -n {{ share.id }} -g {{ '001' if share.public else '000' }}"
loop: "{{ samba_shares }}"
loop_control:
label: "{{ share.id }}"
loop_var: share
when:
- samba_allowed_hosts is defined
- samba_netbios_name is defined
- samba_workgroup is defined
- samba_shares is defined
- (samba_shares_stat.results | selectattr('share.id','equalto',share.id))[0].stat.exists