This repository was archived by the owner on Jan 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipa.yml
More file actions
132 lines (131 loc) · 4.35 KB
/
ipa.yml
File metadata and controls
132 lines (131 loc) · 4.35 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
- hosts: ipa
strategy: free
gather_facts: true
become: true
tasks:
- name: Setting Hostname
command: hostnamectl set-hostname ipa.example.com
- name: Fixing hosts file
lineinfile:
dest: /etc/hosts
regexp: '^127\.0\.0\.1'
state: absent
- name: Adding localhost IPV4 address to host file
lineinfile:
path: /etc/hosts
line: 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
create: yes
- name: Adding localhost IPV6 address to host file
lineinfile:
path: /etc/hosts
line: ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
create: yes
- name: Adding IPA address to hosts file
lineinfile:
path: /etc/hosts
line: 192.168.55.5 ipa.example.com ipa
create: yes
- name: Adding system1 address to hosts file
lineinfile:
path: /etc/hosts
line: 192.168.55.6 system1.example.com system1
create: yes
- name: Adding repo address to hosts file
lineinfile:
path: /etc/hosts
line: 192.168.55.4 repo.example.com repo
create: yes
- name: Configuring network
shell: nmcli con mod "System eth1" ipv4.addresses 192.168.55.5/24 ipv4.gateway 192.168.55.1 ipv4.dns 8.8.8.8 ipv4.dns-search example.com ipv4.method manual
- name: Enabling services
service: name={{item}} enabled=true
with_items:
- httpd
- firewalld
- name: Starting Firewalld
service: name=firewalld state=started
- name: Enabling Firewall Services
command: firewall-cmd --permanent --add-service=http --add-service=https --add-service=ntp --add-service=dns --add-service=kerberos --add-service=ldap --add-service=ldaps --add-service=ftp
- name: Reloaded Firewall. Configuring IPA server...(Est. Time - 7 minutes)
command: firewall-cmd --reload
- name: Finishing IPA server Configuration
command: ipa-server-install --setup-dns --allow-zone-overlap --auto-reverse -a 'password' --hostname=ipa.example.com -r EXAMPLE.COM -p 'password' -n example.com -U --forwarder 8.8.8.8
- name: Adding IPA user 'dave'
ipa_user:
name: dave
state: present
krbpasswordexpiration: 20200119235959
givenname: dave
sn: dave
mail:
- dave@example.com
telephonenumber:
- '+555123456'
sshpubkey:
password: password
uidnumber: 1001
gidnumber: 1000
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: password
- name: Adding IPA user 'lisa'
ipa_user:
name: lisa
state: present
krbpasswordexpiration: 20200119235959
givenname: lisa
sn: lisa
mail:
- lisa@example.com
telephonenumber:
- '+555123456'
sshpubkey:
password: password
uidnumber: 1002
gidnumber: 1001
ipa_host: ipa.example.com
ipa_user: admin
ipa_pass: password
- name: Setting SELinux To Permissive
shell: setenforce 0
ignore_errors: yes
- name: Creating Welcome Message
file:
path: /etc/profile.d/welcome.sh
state: touch
mode: 0755
- name: You're IPA server for RHEL 7 has been setup!
debug:
msg:
- 'Accessing The System:'
- '- IPA - 192.168.55.5'
- '- Username - vagrant'
- '- Password - vagrant'
- '- Access example - `ssh vagrant@192.168.55.5` or `vagrant ssh ipa`'
- '- Happy Studying!'
- name: Building Welcome Message
blockinfile:
dest: /etc/profile.d/welcome.sh
block: |
#!/bin/bash
#
echo -e '
# _ _ _
# /\ \ /\ \ / /\
# \ \ \ / \ \ / / \
# /\ \_\ / /\ \ \ / / /\ \
# / /\/_/ / / /\ \_\/ / /\ \ \
# / / / / / /_/ / / / / \ \ \
# / / / / / /__\/ / / /___/ /\ \
# / / / / / /_____/ / /_____/ /\ \
# ___/ / /__ / / / / /_________/\ \ \
# /\__\/_/___/ / / / / /_ __\ \_\
# \/_________\/_/ \_\___\ /____/_/
'"#
#
# You are logged into \"`hostname`\" as user \"`whoami`\"
# This system is running `cat /etc/redhat-release`
# kernel is `uname -r`
"
...