-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig-ldap-clients.yml
65 lines (54 loc) · 1.83 KB
/
config-ldap-clients.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
- name: config ldap server on co-ldap
hosts: pri-dns.fdauti.ops
become: yes
tasks:
- name: install yum-utils package
yum:
name: yum-utils
state: present
- name: add openldap repo
command:
cmd: /usr/bin/yum-config-manager --add-repo=https://repo.symas.com/configs/SOFL/rhel8/sofl.repo
creates: /etc/yum.repos.d/sofl.repo
- name: update/install ldap packages
yum:
name: "{{item}}"
state: latest
disable_gpg_check: yes
loop: ["symas-openldap-clients","sssd","sssd-ldap","sssd-tools","openssl-perl"]
- name: install ldap server cert into the clients
shell:
cmd: openssl s_client -connect 192.168.7.4:636 -showcerts < /dev/null | openssl x509 -text > /etc/openldap/certs/vm1.lab.fdauti.ops.crt
- name: copy/update sssd.conf to clients
copy:
src: ../lab3/client/sssd.conf
dest: /etc/sssd/sssd.conf
owner: root
group: root
mode: '0600'
- name: apply new configuration to sssd
command: authselect select sssd --force
- name: sssd service enable and restart
service:
name: sssd
state: restarted
enabled: yes
- name: enable ldapsearch commands on client
copy:
src: ../lab3/client/ldap.conf
dest: /etc/openldap/ldap.conf
owner: root
group: root
mode: '0644'
- name: config. firewalld for ens224
firewalld:
zone: internal
interface: ens224
state: enabled
permanent: yes
immediate: yes
#commands for testing and excecution
# ansible-playbook --syntax-check config-ldap-clients.yml
# ansible-playbook --list-tasks config-ldap-clients.yml
# ansible-playbook --check config-ldap-clients.yml
# ansible-playbook config-ldap-clients.yml