ansible/roles/samba/tasks/install.yaml

44 lines
857 B
YAML

---
- name: Update and upgrade packages
apt:
update_cache: true
upgrade: true
autoremove: true
become: true
- name: Install Samba dependencies
apt:
name: "{{ smb_deps }}"
state: present
become: true
- name: Add group "{{smb_group}}"
group:
name: "{{smb_group}}"
state: present
become: true
- name: Change permission on share
file:
path: "{{ smb_media_dir }}"
group: "{{smb_group}}"
mode: "2770"
become: true
- name: Add user "{{ smb_user }}"
user:
name: "{{ smb_user }}"
shell: "/sbin/nologin"
groups: "{{ smb_group }}"
append: true
become: true
register: new_user
- name: Add password to "{{ smb_user }}"
shell:
cmd: smbpasswd -a "{{ smb_user }}"
stdin: "{{ vault_smb_user_password }}\n{{ vault_smb_user_password }}"
become: true
when: new_user.changed