homelab/roles/samba/tasks/main.yml

39 lines
770 B
YAML
Raw Permalink Normal View History

2022-12-02 21:23:33 +01:00
- name: Install Samba
apt:
name: samba
state: present
- name: Ensure smbd is running & enabled.
service:
name: smbd
state: started
enabled: true
- name: Create family account for share access
user:
name: lambroek
state: present
create_home: false
groups:
- data
2023-12-24 20:52:13 +01:00
password: "{{ lambroek_password | password_hash('sha512') }}"
2022-12-02 21:23:33 +01:00
shell: /sbin/nologin
2023-12-24 20:52:13 +01:00
notify: smbpasswd-lambroek
2022-12-03 09:07:47 +01:00
- name: Ensure Jef share directory is present
ansible.builtin.file:
path: '/mnt/data1/jef'
state: 'directory'
mode: '0775'
owner: 'debian'
group: 'data'
2022-12-02 21:23:33 +01:00
- name: Copy over smb config file
copy:
src: smb.conf
dest: /etc/samba/smb.conf
owner: root
group: root
mode: '644'
notify: restart-smbd