2021-02-20 15:58:23 +01:00
|
|
|
---
|
2021-12-14 20:26:49 +01:00
|
|
|
- name: ensure smb share directories exist
|
2021-02-20 15:58:23 +01:00
|
|
|
become: yes
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ item.path }}"
|
|
|
|
state: directory
|
|
|
|
mode: 0777
|
|
|
|
loop: "{{ smb_shares }}"
|
2021-12-14 20:26:49 +01:00
|
|
|
notify: set samba passwords
|
2021-02-20 15:58:23 +01:00
|
|
|
|
2021-12-14 20:26:49 +01:00
|
|
|
- name: template share configuration
|
2021-02-20 15:58:23 +01:00
|
|
|
become: yes
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: smb.conf.j2
|
|
|
|
dest: /etc/samba/smb.conf
|
|
|
|
validate: 'testparm -s %s'
|
|
|
|
with_items:
|
|
|
|
- "{{ smb_shares }}"
|
|
|
|
notify:
|
2021-12-14 20:26:49 +01:00
|
|
|
- restart smbd
|
|
|
|
- set samba passwords
|