--- # tasks file for create_samba_user - name: Create ansible.builtin.blockinfile: state: present owner: root group: root insertafter: EOF path: /etc/samba/smb.conf mode: '0644' block: | [{{ samba_user }}] comment = {{ samba_user }} samba path = {{ samba_mountpoint }} browseable = yes writeable = yes read only = no create mask = 0644 directory mask = 0755 valid users = {{ samba_user }} notify: smb restart