client-pull-installation/roles/domain/tasks/smb_config.yml

41 lines
917 B
YAML

---
# SAMBA configuration for domain
- name: Configuring SAMBA
template:
src: smb.conf
dest: /etc/samba/smb.conf
validate: 'testparm -s %s'
backup: yes
register: cfg_samba
- name: Configuring AppArmor home directories
replace:
dest: /etc/apparmor.d/tunables/home
regexp: '^@\{HOMEDIRS\}=/home/$'
replace: '@{HOMEDIRS}=/home/ /home/{{ ansible_local.domain.domainshort }}/'
- name: SAMBA restart
shell: /sbin/restart smbd
when: cfg_samba is changed
- name: Winbind restart
shell: /sbin/restart winbind
when: cfg_samba is changed
- name: Creating home base
file:
path: '/home/{{ ansible_local.domain.domainshort }}'
owner: root
group: root
state: directory
- name: Permitting SAMBA domopers to run sudo
template:
src: sudoers.d
dest: /etc/sudoers.d/domain
owner: root
group: root
mode: 0440
validate: "/usr/sbin/visudo -cf %s"