forked from tmichett/quay_lab_poc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Quay_Restart.yml
138 lines (125 loc) · 4.09 KB
/
Quay_Restart.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
---
- name: Deploy Quay after Quay_Prepare.yml Playbook
hosts: quay
vars:
fw_ports:
- 8443/tcp ## Quay
- 8080/tcp ## Quay
- 443/tcp ## Quay
- 5432/tcp ## Postgres for Quay
- 6379/tcp ## Redis for Quay
- 5433/tcp ## Postgres for Clair
- 8081/tcp ## Clair V4
clair_v4: 8001:8080
postgres_clairv4: 5433:5432
redis: 6379:6379
postgres: 5432:5432
quay: 8080:8080
QUAY_DIR: /quay
vars_files:
- registry_login.yml
- postgres_vars.yml
- redis_vars.yml
- quay_config_vars.yml
- clair_vars.yml
collections:
- containers.podman
### Tasks for this playbook will setup a Quay Container Registry
### This will setup and configure a non-production registry
### based on https://access.redhat.com/documentation/en-us/red_hat_quay/3.5/html/deploy_red_hat_quay_for_proof-of-concept_non-production_purposes/getting_started_with_red_hat_quay#registry_authentication
tasks:
## Start and Run the Quay Container
## This is done after the configuration of QUAY for config container or config file updates
- name: Start the Postrgres Container
podman_container:
name: postgresql-quay
image: registry.redhat.io/rhel8/postgresql-10:1
state: started
restart: yes
volume:
- "{{ QUAY_DIR }}/postgres-quay:/var/lib/pgsql/data:Z"
ports:
- "5432:5432"
env:
POSTGRESQL_USER: "{{ pg_user }}"
POSTGRESQL_PASSWORD: "{{ pg_pass }}"
POSTGRESQL_DATABASE: "{{ pg_db }}"
POSTGRESQL_ADMIN_PASSWORD: "{{ pg_admin_pass }}"
- name: Start the Redis Container
podman_container:
name: redis
image: registry.redhat.io/rhel8/redis-5:1
state: started
restart: yes
ports:
- "6379:6379"
env:
REDIS_PASSWORD: "{{ redis_pass }}"
- name: Start the Postrgres-Clair Container
podman_container:
name: postgresql-clairv4
image: registry.redhat.io/rhel8/postgresql-10:1
state: started
restart: yes
volume:
- "{{ QUAY_DIR }}/{{ clair_directory }}:/var/lib/pgsql/data:Z"
ports:
- "5433:5432"
env:
POSTGRESQL_USER: "{{ clair_pg_user }}"
POSTGRESQL_PASSWORD: "{{ clair_pg_pass }}"
POSTGRESQL_DATABASE: "{{ clair_pg_db }}"
POSTGRESQL_ADMIN_PASSWORD: "{{ clair_pg_admin_pass }}"
## Insert Pause to wait for PostGres Container to Come online
- name: Wait for Database containers to come online
pause:
seconds: 30
- name: Start the Clair Container
podman_container:
name: clairv4
image: registry.redhat.io/quay/clair-rhel8:v3.6.0-70
state: started
restart: yes
volume:
- "{{ clair_config_dir }}/config:/clair:Z"
ports:
- "8081:8081"
- "8089:8089"
env:
CLAIR_CONF: /clair/config.yaml
CLAIR_MODE: combo
## Insert Pause to wait for PostGres Container to Come online
- name: Wait for Clair containers to come online
pause:
seconds: 15
- name: Start the Quay Container
podman_container:
name: quay
image: registry.redhat.io/quay/quay-rhel8:v3.6.0-62
state: started
restart: yes
ports:
- "80:8080"
volume:
- "{{ QUAY_DIR }}/config:/conf/stack:Z"
- "{{ QUAY_DIR }}/storage:/datastorage:Z"
- name: Start the Quay Mirror Container
podman_container:
name: mirroring-worker
image: registry.redhat.io/quay/quay-rhel8:v3.6.0-62
state: started
restart: yes
volume:
- "{{ QUAY_DIR }}/config:/conf/stack:Z"
command: repomirror
- name: Restart the Quay Container as Configuration File Might not have been read
podman_container:
name: quay
image: registry.redhat.io/quay/quay-rhel8:v3.6.0-62
state: started
restart: yes
ports:
- "80:8080"
volume:
- "{{ QUAY_DIR }}/config:/conf/stack:Z"
- "{{ QUAY_DIR }}/storage:/datastorage:Z"