-
Notifications
You must be signed in to change notification settings - Fork 21
/
main.yml
77 lines (67 loc) · 1.49 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
- name: Set facts for client
set_fact:
domains: []
client_fqdn: "{{ inventory_hostname }}"
- name: Create /enrollment directory
file:
path: /enrollment
state: directory
owner: root
group: root
mode: '0700'
- name: Join IPA domain
ansible.builtin.include_tasks:
file: enroll_IPA.yml
when:
- '"ipa" in groups and groups["ipa"]'
- join_ipa
- name: Join Samba domain
ansible.builtin.include_tasks:
file: enroll_samba.yml
when:
- '"samba" in groups and groups["samba"]'
- join_samba
- name: Join ldap domain
block:
- name: Add ldap to domains
set_fact:
domains: "{{ domains + [service.ldap.domain] }}"
when:
- '"ldap" in groups and groups["ldap"]'
- join_ldap
- name: Join AD
ansible.builtin.include_tasks:
file: enroll_AD.yml
when:
- '"ad" in groups and groups["ad"]'
- join_ad
- name: Stop SSSD
service:
name: sssd.service
enabled: yes
state: stopped
- name: Create /etc/sssd/sssd.conf
template:
src: sssd.conf
dest: /etc/sssd/sssd.conf
owner: root
group: root
mode: 0600
- name: Create /etc/krb5.conf
template:
src: krb5.conf
dest: /etc/krb5.conf
owner: root
group: root
mode: 0644
- name: Set SELinux label for /enrollment
shell: |
if selinuxenabled; then
semanage fcontext -a -t etc_t "/enrollment(/.*)*"
restorecon -R -v /enrollment
else
exit 0
fi
- name: Show configured domains
debug:
msg: "domains = {{ ', '.join(domains) }}"