-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup-ansible.yml
183 lines (166 loc) · 4.61 KB
/
setup-ansible.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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
---
- name: setup-ansible
hosts: localhost
connection: local
vars:
rh_aap_controller: rh-ansiblecontroller-01.cool.lab
rh_aap_edanode: rh-edanode-01.cool.lab
rh_aap_exnode: rh-exnode-01.cool.lab
rh_aap_database: rh-ansibledatabase-01.cool.lab
roles:
- role: vm-machine-coollab
# The ansible-controller-01
memory_mb: 16384
num_cpus: 2
vm_state: poweredon
net_name: RH-seg-2991
net_type: static
ip: "{{ hostvars[ rh_aap_controller ].ansible_host }}"
netmask: 255.255.255.0
gateway: "{{ ipaserver_gw }}"
vm_name: rh-ansiblecontroller-01
domain: "{{ ipaserver_domain }}"
dns_servers:
- "{{ dns_forwarder1_ip }}"
- "{{ dns_forwarder2_ip }}"
update_inventory: false
inventory_groups:
- aapcontroller
- ansibleautomationplatform
# net_name: vlan1010
- role: vm-machine-coollab
# The ansible-controller-01
memory_mb: 16384
num_cpus: 2
vm_state: poweredon
net_name: RH-seg-2991
net_type: static
ip: "{{ hostvars[ rh_aap_database ].ansible_host }}"
netmask: 255.255.255.0
gateway: "{{ ipaserver_gw }}"
vm_name: rh-ansibledatabase-01
domain: "{{ ipaserver_domain }}"
dns_servers:
- "{{ dns_forwarder1_ip }}"
- "{{ dns_forwarder2_ip }}"
update_inventory: false
inventory_groups:
- ansibleautomationplatform
# net_name: vlan1010
- role: vm-machine-coollab
# The edanode-01
memory_mb: 16384
num_cpus: 2
vm_state: poweredon
net_name: RH-seg-2991
net_type: static
ip: "{{ hostvars[ rh_aap_edanode ].ansible_host }}"
netmask: 255.255.255.0
gateway: "{{ ipaserver_gw }}"
vm_name: rh-ansibleeda-01
domain: "{{ ipaserver_domain }}"
dns_servers:
- "{{ dns_forwarder1_ip }}"
- "{{ dns_forwarder2_ip }}"
update_inventory: false
inventory_groups:
- aapnodes
- ansibleautomationplatform
- role: vm-machine-coollab
# The exnode-01
memory_mb: 16384
num_cpus: 2
vm_state: poweredon
net_name: RH-seg-2992
net_type: static
ip: "{{ hostvars[ rh_aap_exnode ].ansible_host }}"
netmask: 255.255.255.0
gateway: "{{ ipaserver_gw }}"
vm_name: rh-exnode-01
domain: "{{ ipaserver_domain }}"
dns_servers:
- "{{ dns_forwarder1_ip }}"
- "{{ dns_forwarder2_ip }}"
update_inventory: false
inventory_groups:
- aapnodes
- ansibleautomationplatform
# - import_playbook: ensure-vm-state.yml
# vars:
# memory_mb: 4096
# num_cpus: 2
# vm_state: poweredon
# net_name: RH-seg-2991
# net_type: dhcp
# name: rh-ansible-controller-01.coollab
# # net_name: vlan1010
# - name: update inventory
# hosts: localhost
# connection: local
# gather_facts: false
# tasks:
# - name: debug host ip
# debug:
# var: host_ip
# - name: fix inventory with Ansible Controller
# add_host:
# name: "{{ host_ip }}"
# groups:
# - aapcontroller
# - ansibleautomationplatform
# - import_playbook: ensure-vm-state.yml
# vars:
# memory_mb: 2048
# num_cpus: 2
# vm_state: poweredon
# net_name: RH-seg-2991
# net_type: dhcp
# name: rh-exnode-01.coollab
# # net_name: vlan1010
# - name: update inventory
# hosts: localhost
# connection: local
# gather_facts: false
# tasks:
# - name: debug host ip
# debug:
# var: host_ip
# - name: fix inventory with ipaserver
# add_host:
# name: "{{ host_ip }}"
# groups:
# - aapnodes
# - ansibleautomationplatform
- name: setup stuff at all aap servers
import_playbook: prepare-rhel8.yml
vars:
install_pkgs_list:
- tmux
- vim
- insights-client
tags: prep
- name: setup idmclient at all aap servers
import_playbook: setup-idmclient.yml
tags: prep
- name: add aap servers to local hosts file on servers
import_playbook: aap_add_to_hosts.yml
- name: create a temporary private key file from vault
hosts:
automationcontroller
tasks:
- name: create a temporary private key file from vault
copy:
owner: root
mode: 0600
content: "{{ admin_ssh_private_key }}"
dest: ~/.ssh/aaptempid
- name: setup ansible at all app servers
import_playbook: install-aap21.yml
- name: create a temporary private key file from vault
hosts:
automationcontroller
tasks:
- name: delete temporary private key
ansible.builtin.file:
path: ~/.ssh/aaptempid
state: absent