# https://pimylifeup.com/raspberry-pi-samba/ --- - name: 'Install required apt packages' apt: name: - 'samba' - 'samba-common-bin' state: 'present' update_cache: true - name: 'Copy conf files' template: src: 'smb.conf' dest: '/etc/samba/smb.conf' mode: '644' - name: 'Add Samba user' expect: command: 'sudo smbpasswd -a {{ samba_user }}' responses: (?i)password: "{{ samba_user_pass }}" - name: 'Restart Samba' systemd: name: '{{ item }}' state: 'restarted' loop: - 'smbd'