diff options
| author | Kumar Damani <me@kumardamani.net> | 2022-08-23 16:02:28 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2022-09-07 20:15:37 +0000 |
| commit | c85806e3289b5e207d51d382f8dc75edad04404d (patch) | |
| tree | 244d2f1ad38320863fb60f695c88c97799be1171 /roles/samba | |
| parent | 4d34de2f5e757bfeae5738547aabb61d3d28a2f8 (diff) | |
switched to alpine initial commit
Diffstat (limited to 'roles/samba')
| -rw-r--r-- | roles/samba/tasks/main.yaml | 20 | ||||
| -rw-r--r-- | roles/samba/templates/smb.conf | 2 |
2 files changed, 18 insertions, 4 deletions
diff --git a/roles/samba/tasks/main.yaml b/roles/samba/tasks/main.yaml index 5207ac5..c89d4bc 100644 --- a/roles/samba/tasks/main.yaml +++ b/roles/samba/tasks/main.yaml @@ -1,13 +1,19 @@ -# https://pimylifeup.com/raspberry-pi-samba/ --- -- name: 'Install required apt packages' +- name: 'Install samba for Alpine' + apk: + name: 'samba' + state: 'latest' + when: 'ansible_os_family == "Alpine"' + +- name: 'Install samba for Debian' apt: name: - 'samba' - 'samba-common-bin' state: 'present' update_cache: true + when: 'ansible_os_family == "Debian"' - name: 'Copy conf files' template: @@ -17,7 +23,7 @@ - name: 'Add Samba user' expect: - command: 'sudo smbpasswd -a {{ samba_user }}' + command: 'smbpasswd -a {{ samba_user }}' responses: (?i)password: "{{ samba_user_pass }}" @@ -27,3 +33,11 @@ state: 'restarted' loop: - 'smbd' + when: 'ansible_os_family == "Debian"' + +- name: 'Start and enable samba' + service: + name: 'samba' + state: 'started' + enabled: true + when: 'ansible_os_family == "Alpine"' diff --git a/roles/samba/templates/smb.conf b/roles/samba/templates/smb.conf index eb5839a..5c1360a 100644 --- a/roles/samba/templates/smb.conf +++ b/roles/samba/templates/smb.conf @@ -1,5 +1,5 @@ [data] -path = {{ data_vol_ssd }} +path = {{ samba_data_root }} writeable=Yes create mask=0777 directory mask=0777 |
