forked from LibreSchool/libreschool-nfs
82 lines
2.2 KiB
YAML
82 lines
2.2 KiB
YAML
|
---
|
||
|
|
||
|
- name: Kerberos configuration
|
||
|
debconf:
|
||
|
name: krb5-config
|
||
|
question: krb5-config/default_realm
|
||
|
value: "AD.{{ esmith.DomainName|upper }}"
|
||
|
vtype: string
|
||
|
|
||
|
- name: Samba configuration
|
||
|
debconf:
|
||
|
name: samba-common
|
||
|
question: samba-common/workgroup
|
||
|
value: "{{ esmith.sssd.Workgroup }}"
|
||
|
vtype: string
|
||
|
|
||
|
- name: Samba configuration
|
||
|
debconf:
|
||
|
name: samba-common
|
||
|
question: samba-common/do_debconf
|
||
|
value: true
|
||
|
vtype: boolean
|
||
|
|
||
|
- name: Samba configuration
|
||
|
debconf:
|
||
|
name: samba-common
|
||
|
question: samba-common/dhcp
|
||
|
value: true
|
||
|
vtype: boolean
|
||
|
|
||
|
- name: Installing sssd required packages
|
||
|
apt:
|
||
|
name: [ 'sssd-tools', 'sssd-ad', 'samba', 'krb5-user' ]
|
||
|
state: latest
|
||
|
|
||
|
- name: SSSD configuration
|
||
|
template:
|
||
|
src: 'sssd.conf'
|
||
|
dest: '/etc/sssd/sssd.conf'
|
||
|
owner: 'root'
|
||
|
group: 'root'
|
||
|
mode: 0600
|
||
|
notify: restart sssd
|
||
|
|
||
|
- name: Smb.conf
|
||
|
ini_file:
|
||
|
path: /etc/samba/smb.conf
|
||
|
section: global
|
||
|
option: "{{ item.option }}"
|
||
|
value: "{{ item.value }}"
|
||
|
no_extra_spaces: yes
|
||
|
with_items:
|
||
|
- { option: "workgroup", value: "{{ esmith.sssd.Workgroup }}" }
|
||
|
- { option: "client signing", value: "yes" }
|
||
|
- { option: "client use spnego", value: "yes" }
|
||
|
- { option: "kerberos method", value: "secrets and keytab" }
|
||
|
- { option: "realm", value: "AD.{{ esmith.DomainName|upper }}" }
|
||
|
- { option: "security", value: "ads" }
|
||
|
- { option: "interfaces", value: "{{ ansible_default_ipv4.interface }}" }
|
||
|
notify: restart smbd
|
||
|
|
||
|
- name: Check if joined to domain
|
||
|
shell: "net rpc testjoin"
|
||
|
changed_when: no
|
||
|
ignore_errors: true
|
||
|
register: domain_join_status
|
||
|
|
||
|
- name: Check for domain administrator password file
|
||
|
local_action: stat path=/var/lib/nethserver/secrets/administrator
|
||
|
register: stat_domain_admin_password_file
|
||
|
|
||
|
- include: domain_join.yml
|
||
|
when:
|
||
|
- domain_join_status.rc != 0
|
||
|
- stat_domain_admin_password_file.stat.exists
|
||
|
|
||
|
- name: Enable home directory creation
|
||
|
lineinfile:
|
||
|
path: /etc/pam.d/common-session
|
||
|
state: present
|
||
|
line: 'session required pam_mkhomedir.so skel=/etc/skel/ umask=0077'
|