-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker_upgrade_playbook.yml
202 lines (188 loc) · 7.35 KB
/
docker_upgrade_playbook.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
---
- hosts: docker
name: Docker Upgrade Playbook
gather_facts: false
handlers:
- name: Set trusted domain
ansible.builtin.command: docker exec -u www-data nextcloud php occ --no-warnings "config:system:set" trusted_domains 1 --value="{{ cloud_url }}"
- name: Overwrite protocol
ansible.builtin.command: docker exec -u www-data nextcloud php occ --no-warnings "config:system:set" overwriteprotocol --value="https"
tasks:
## Proxy
- name: Restart proxy dockers
community.docker.docker_compose:
project_src: /home/docker/inverseproxy
pull: true
when: inventory_hostname in groups.docker
tags: upgrade_proxy
# Auth images
# OpenLDAP
- name: Pull auth OpenLDAP docker image
community.docker.docker_image:
name: lefilament/openldap
source: pull
force_source: true
when: inventory_hostname in groups.docker_auth
tags: upgrade_auth, pull_openldap
# PhpLDAPAdmin
- name: Pull auth PhpLDAPAdmin docker image
community.docker.docker_image:
name: osixia/phpldapadmin
source: pull
force_source: true
when: inventory_hostname in groups.docker_auth
tags: upgrade_auth, pull_phpldapadmin
# LemonLDAP
- name: Rebuild auth sso Docker
community.docker.docker_image:
build:
path: /home/docker/auth/sso
pull: true
name: filament/lemonldap:1.9-debian
source: build
force_source: true
when: inventory_hostname in groups.docker_auth
tags: upgrade_auth, build_lemonldap
# Auth
- name: Restart auth dockers
community.docker.docker_compose:
project_src: /home/docker/auth
when: inventory_hostname in groups.docker_auth
tags: upgrade_auth
## Draw.io image
- name: Pull draw.io docker image
community.docker.docker_compose:
project_src: /home/docker/
files: draw.io.yaml
project_name: draw.io
pull: true
when: inventory_hostname in groups.docker_drawio
tags: upgrade_drawio
## Etherpad image
- name: Pull etherpad and postgres docker images
community.docker.docker_compose:
project_src: /home/docker/etherpad
pull: true
when: inventory_hostname in groups.docker_etherpad
tags: upgrade_etherpad
## Framadate image
- name: Pull framadate and mariadb docker images
community.docker.docker_compose:
project_src: /home/docker/
files: framadate.yaml
project_name: framadate
pull: true
when: inventory_hostname in groups.docker_framadate
tags: upgrade_framadate
## Jitsi image
- name: Pull Jitsi images
community.docker.docker_compose:
project_src: /home/docker/
files: jitsi.yaml
project_name: jitsi
pull: true
when: inventory_hostname in groups.docker_jitsi
tags: upgrade_jitsi
## Nagios images
- name: Pull nagios docker image
community.docker.docker_compose:
project_src: /home/docker/nagios/
pull: true
when: inventory_hostname in groups.docker_nagios
tags: upgrade_nagios
## NextCloud images
- name: Pull nextcloud docker images
community.docker.docker_compose:
project_src: /home/docker/nextcloud
pull: true
async: 600
poll: 10
when: inventory_hostname in groups.docker_nextcloud and not ansible_check_mode
tags: upgrade_nextcloud
notify:
- Set trusted domain
- Overwrite protocol
## Odoo
# Please use docker_odoo_operations_playbook.yml for Odoo image operations,
# only non Odoo images are included here below
# Postgres
- name: Pull odoo postgres docker image
community.docker.docker_image:
name: postgres:{{ odoo_setup_conf[item.value.odoo_setup_version | default(odoo_setup_version)].postgres_version }}-alpine
source: pull
force_source: true
when: inventory_hostname in groups.docker_odoo
tags: upgrade_odoo, pull_postgres
# Mailhog
- name: Pull odoo mailhog docker image
community.docker.docker_image:
name: mailhog/mailhog
source: pull
force_source: true
when: inventory_hostname in groups.docker_odoo
tags: upgrade_odoo, pull_mailhog
# Whitelists
- name: Pull odoo docker whitelists
community.docker.docker_image:
name: tecnativa/whitelist
source: pull
force_source: true
when: inventory_hostname in groups.docker_odoo and restrict_internet_access | default(false)
tags: upgrade_odoo, pull_whitelists
# Postfix relay
- name: Pull odoo postfix docker image
community.docker.docker_image:
name: tecnativa/postfix-relay
source: pull
force_source: true
when: inventory_hostname in groups.docker_odoo and mailname is defined
tags: upgrade_odoo, pull_postfix
# Metabase
- name: Pull odoo metabase docker image
community.docker.docker_image:
name: metabase/metabase
source: pull
force_source: true
when: inventory_hostname in groups.docker_odoo and odoo_instances.values() | list | selectattr('metabase', 'defined')
tags: upgrade_odoo, pull_metabase
## Owncloud images
- name: Pull owncloud docker images
community.docker.docker_compose:
project_src: /home/docker/
files: owncloud.yaml
project_name: owncloud
pull: true
async: 120
poll: 10
when: inventory_hostname in groups.docker_owncloud and not ansible_check_mode
tags: upgrade_owncloud
## PrivateBin image
- name: Pull privatebin docker image
community.docker.docker_compose:
project_src: /home/docker/
files: privatebin.yaml
project_name: privatebin
pull: true
when: inventory_hostname in groups.docker_privatebin
tags: upgrade_privatebin
# Backup images
# Cloud, Framadate
- name: Rebuild backup-mysql docker image
community.docker.docker_image:
build:
path: /home/docker/backups
dockerfile: Dockerfile-mysql
pull: true
name: filament/duplicity:mysql
source: build
force_source: true
when: inventory_hostname in groups.docker_owncloud | union(groups.docker_nextcloud) | union(groups.docker_framadate) | intersect(groups.maintenance_contract)
tags: upgrade_owncloud, upgrade_nextcloud, upgrade_framadate, build_backup_mysql
# Auth, Odoo, Privatebin
- name: Rebuild backup-odoo docker
community.docker.docker_image:
name: ghcr.io/tecnativa/docker-duplicity-postgres:master
source: pull
force_source: true
when: inventory_hostname in groups.docker_auth | union(groups.docker_odoo) | union(groups.docker_privatebin) | intersect(groups.maintenance_contract)
tags: upgrade_auth, upgrade_odoo, upgrade_privatebin, pull_backup_odoo