-
Notifications
You must be signed in to change notification settings - Fork 11
/
deploy.yml
259 lines (231 loc) · 6.07 KB
/
deploy.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
---
- hosts: quaysystems
vars_files:
- vars/main.yml
handlers:
- name: Include all handlers
import_tasks: handlers/main.yml
tasks:
- name: Register system to satellite and repos
include_role:
name: register-system
when: SATELLITE_REGISTER == True and SATELLITE_REGISTER is defined
tags:
- register
- hosts: quaydatabase
vars_files:
- vars/main.yml
handlers:
- name: Include all handlers
import_tasks: handlers/main.yml
tags:
- database
tasks:
- name: Deploy docker to database container host
include_tasks: tasks/deploy-docker.yml
vars:
docker_packages:
- docker
- python-docker-py
- MySQL-python
when: QUAY_DATABASE_CONTAINERIZE
tags:
- database
- name: Deploy python components for Ansible to database container host
yum:
name: MySQL-python
state: latest
when: not QUAY_DATABASE_CONTAINERIZE
tags:
- database
- name: Configure firewall
include_tasks: tasks/firewall-setup.yml
vars:
ports:
- 3306/tcp
firewall_zone: public
when: QUAY_MYSQL_DEPLOY and not QUAY_DATABASE_CONTAINERIZE
tags:
- database
- name: Configure firewall
include_tasks: tasks/firewall-setup.yml
vars:
ports:
- 3306/tcp
firewall_zone: trusted
when: QUAY_MYSQL_DEPLOY and QUAY_DATABASE_CONTAINERIZE
tags:
- database
- name: Login to quay.io
docker_login:
username: "{{ QUAY_IO_USERNAME }}"
password: "{{ QUAY_IO_PASSWORD }}"
registry: "{{ QUAY_IO_REGISTRY_URL }}"
when: QUAY_IO_USERNAME is defined
- name: Login to Red Hat Registry
docker_login:
username: "{{ UPSTREAM_REGISTRY_USERNAME }}"
password: "{{ UPSTREAM_REGISTRY_PASSWORD }}"
registry: "{{ UPSTREAM_REGISTRY_URL }}"
when: UPSTREAM_REGISTRY_USERNAME is defined
- name: Deploy conatinerized mysql
include_tasks: tasks/deploy-mysql.yml
when: QUAY_MYSQL_DEPLOY and QUAY_DATABASE_CONTAINERIZE
tags:
- database
- name: Deploy mysql
include_role:
name: robertdebock.mysql
vars:
_mysql_service:
default:
mysql
RedHat-7:
rh-mariadb103-mariadb
_mysql_packages:
default:
- mariadb-server
- mariadb-devel
- python2-mysql
RedHat-7:
- rh-mariadb103-scldevel.x86_64
- rh-mariadb103-syspaths
- MySQL-python
when: QUAY_MYSQL_DEPLOY and not QUAY_DATABASE_CONTAINERIZE
tags:
- database
- name: Configure firewall for PostgreSQL
include_tasks: tasks/firewall-setup.yml
vars:
ports:
- "{{ POSTGRES_PORT_5432_TCP_PORT }}/tcp"
firewall_zone: trusted
when: QUAY_POSTGRESQL_DEPLOY
tags:
- database
- name: Deploy PostgreSQL
include_tasks: tasks/deploy-postgresql.yml
when: QUAY_POSTGRESQL_DEPLOY
tags:
- database
# - name: Deploy postgres
# include_role:
# name: geerlingguy.postgresql
# vars:
# __postgresql_version: "9.6"
# __postgresql_data_dir: "/var/opt/rh/rh-postgresql96/lib/pgsql/data"
# __postgresql_bin_path: "/usr/bin"
# __postgresql_config_path: "/var/opt/rh/rh-postgresql96/lib/pgsql/data"
# __postgresql_daemon: postgresql
# postgresql_users:
# - name: quay
# password: my-secret-password
# postgresql_databases:
# - name: clair
# owner: quay
# state: present
# __postgresql_packages:
# - rh-postgresql96-postgresql-syspaths
# - rh-postgresql96-postgresql-server-syspaths
# - rh-postgresql96-postgresql-contrib-syspaths
# - rh-postgresql96-postgresql-libs
# when: QUAY_POSTGRESQL_DEPLOY and not QUAY_DATABASE_CONTAINERIZE
# tags:
# - database
- name: Test mysql
include_tasks: tasks/mysql-test.yml
when: QUAY_MYSQL_DEPLOY
tags:
- database
- hosts: quayredis
vars_files:
- vars/main.yml
handlers:
- name: Include all handlers
import_tasks: handlers/main.yml
tags:
- redis
tasks:
- name: Deploy docker to redis container host
include_tasks: tasks/deploy-docker.yml
vars:
docker_packages:
- docker
- python-docker-py
when: QUAY_REDIS_CONTAINERIZE
tags:
- redis
- name: Configure firewall
include_tasks: tasks/firewall-setup.yml
vars:
ports:
- 6379/tcp
firewall_zone: public
when: QUAY_REDIS_DEPLOY and not QUAY_REDIS_CONTAINERIZE
tags:
- redis
- name: Configure firewall
include_tasks: tasks/firewall-setup.yml
vars:
ports:
- 6379/tcp
firewall_zone: trusted
when: QUAY_REDIS_DEPLOY and QUAY_REDIS_CONTAINERIZE
tags:
- redis
- name: Deploy redis container
include_tasks: tasks/deploy-redis.yml
when: QUAY_REDIS_CONTAINERIZE
tags:
- redis
- hosts: quay
vars_files:
- vars/main.yml
handlers:
- name: Include all handlers
import_tasks: handlers/main.yml
tags:
- quay
- quay-config
- quay-worker
tasks:
- name: Deploy docker to quay container host
include_tasks: tasks/deploy-docker.yml
vars:
docker_packages:
- docker
- python-docker-py
tags:
- quay
- quay-config
- quay-worker
- name: Configure firewall
include_tasks: tasks/firewall-setup.yml
vars:
ports:
- 443/tcp
- 80/tcp
- 8443/tcp
firewall_zone: public
tags:
- quay
- quay-config
- quay-worker
- name: Deploy quay config container
include_tasks: tasks/quay-config-mode.yml
when: QUAY_CONFIG is defined and QUAY_CONFIG
tags:
- quay-config
- name: Deploy quay container
include_tasks: tasks/deploy-quay.yml
when: QUAY_CONFIG is undefined or not QUAY_CONFIG
tags:
- quay
- name: Deploy quay mirror sync container
include_tasks: tasks/quay-mirror.yml
tags:
- quay-worker
- name: Deploy clair
include_tasks: tasks/quay-clair.yml
tags:
- quay-clair