-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbastion-infra.yml
70 lines (61 loc) · 1.44 KB
/
bastion-infra.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
---
- name: Setup some infrastructure needed for OpenShift install
hosts: registry
vars_files:
- vars/cluster-nodes.yml
tasks:
- name: Install required packages
become: yes
package:
name:
- httpd
- haproxy
state: present
- name: Get services status
service_facts:
- name: Configure firewall if running
when: ansible_facts.services['firewalld.service'].state == "running"
become: yes
firewalld:
port: "{{ item }}/tcp"
immediate: yes
permanent: yes
state: enabled
loop:
- 8080
- 80
- 443
- 6443
- 22623
- name: Modify httpd to use 8080
become: yes
replace:
path: /etc/httpd/conf/httpd.conf
regexp: '^Listen 80$'
replace: 'Listen 8080'
- name: Configure haproxy
become: yes
template:
src: haproxy.cfg.j2
dest: /etc/haproxy/haproxy.cfg
- name: Configure selinux for haproxy
become: yes
seboolean:
name: haproxy_connect_any
state: yes
persistent: yes
- name: Start services
become: yes
service:
name: "{{ item }}"
enabled: yes
state: started
loop:
- httpd
- haproxy
- name: Create doc directory for ignition
become: yes
file:
path: /var/www/html/ignition
state: directory
mode: 0755