forked from r3ap3rpy/ansibler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
domain_join.yaml
57 lines (56 loc) · 1.66 KB
/
domain_join.yaml
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
---
- hosts: centos
become: yes
gather_facts: no
tasks:
- name: Install dependencies
yum:
name: ['realmd','sssd','oddjob','oddjob-mkhomedir','adcli','krb5-workstation','samba-common-tools','sssd-ad']
state: latest
- name: Actually join the domain
shell: |
echo "Start123" | realm join reaperdome -v -U Administrator
realm permit -g [email protected]
realm permit -g [email protected]
realm list
register: results
- name: See the results
debug:
msg: "{{ results }}"
- name: Edit sshd config enable password authentication
replace:
path: /etc/ssh/sshd_config
regexp: 'PasswordAuthentication no'
replace: 'PasswordAuthentication yes'
- name: Edit sshd config
replace:
path: /etc/ssh/sshd_config
regexp: '#KerberosAuthentication no'
replace: 'KerberosAuthentication no'
- name: Edit sshd config
replace:
path: /etc/ssh/sshd_config
regexp: '#KerberosOrLocalPasswd yes'
replace: 'KerberosOrLocalPasswd yes'
- name: Edit sshd config
replace:
path: /etc/ssh/sshd_config
regexp: '#KerberosTicketCleanup yes'
replace: 'KerberosTicketCleanup yes'
- name: Edit sshd config
replace:
path: /etc/ssh/sshd_config
regexp: '#KerberosGetAFSToken no'
replace: 'KerberosGetAFSToken no'
- name: Edit sshd config
replace:
path: /etc/ssh/sshd_config
regexp: '#KerberosUseKuserok yes'
replace: 'KerberosUseKuserok yes'
- name: restart sshd
service:
name: sshd
state: restarted
- name: Add sudoers
shell: |
echo "%[email protected] ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers