ansible/roles/samba/tasks/install.yaml

42 lines
811 B
YAML
Raw Normal View History

---
- 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
- name: Add password to "{{ smb_user }}"
shell:
cmd: smbpasswd -a "{{ smb_user }}"
stdin: "{{ vault_smb_user_password }}\n{{ vault_smb_user_password }}"
become: true