forked from pschiffe/docker-pdns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible-playbook.yml
276 lines (260 loc) · 7.35 KB
/
ansible-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
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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
---
- hosts: localhost
vars:
pdns_master_ip: 172.5.0.20
pdns_slave_ip: 172.5.0.21
wipe: false
c_state: '{{ "absent" if wipe | bool else "started" }}'
i_state: present
alpine: false
tasks:
- name: create docker network
docker_network:
name: pdns-net
state: present
ipam_config:
- subnet: '172.5.0.0/16'
gateway: '172.5.0.1'
tags:
- pdns
- pdns-admin
- pdns-recursor
- name: build pdns recursor
docker_image:
name: pschiffe/pdns-recursor
state: '{{ i_state }}'
source: build
force_source: true
build:
pull: true
path: ./pdns-recursor
tags:
- pdns-recursor
- name: build pdns recursor alpine version
docker_image:
name: pschiffe/pdns-recursor
tag: alpine
state: '{{ i_state }}'
source: build
force_source: true
build:
pull: true
path: ./pdns-recursor
dockerfile: Dockerfile.alpine
tags:
- pdns-recursor
- name: pdns recursor
docker_container:
name: pdns-recursor
image: pschiffe/pdns-recursor:{{ "alpine" if alpine | bool else "latest" }}
state: '{{ c_state }}'
networks_cli_compatible: true
networks:
- name: pdns-net
volumes:
- /etc/localtime:/etc/localtime:ro
tags:
- pdns-recursor
- name: db
docker_container:
name: pdns-mariadb
image: mariadb:10.5
pull: true
state: '{{ c_state }}'
networks_cli_compatible: true
networks:
- name: pdns-net
aliases:
- db
- mysql
volumes:
- /etc/localtime:/etc/localtime:ro
- pdns-mariadb-volume:/var/lib/mysql:z
env:
MYSQL_ROOT_PASSWORD: 'my-secret-pw'
tags:
- db
- name: phpmyadmin
docker_container:
name: pdns-phpmyadmin
image: phpmyadmin/phpmyadmin:5
pull: true
state: '{{ c_state }}'
networks_cli_compatible: true
networks:
- name: pdns-net
published_ports:
- '8888:80'
volumes:
- /etc/localtime:/etc/localtime:ro
tags:
- db
- name: build pdns
docker_image:
name: pschiffe/pdns-mysql
state: '{{ i_state }}'
source: build
force_source: true
build:
pull: true
path: ./pdns
tags:
- pdns
- name: build pdns alpine version
docker_image:
name: pschiffe/pdns-mysql
tag: alpine
state: '{{ i_state }}'
source: build
force_source: true
build:
pull: true
path: ./pdns
dockerfile: Dockerfile.alpine
tags:
- pdns
- name: pdns master
docker_container:
name: pdns
image: pschiffe/pdns-mysql:{{ "alpine" if alpine | bool else "latest" }}
state: '{{ c_state }}'
hostname: enneesseuno.ethiclab.it
networks_cli_compatible: true
networks:
- name: pdns-net
ipv4_address: '{{ pdns_master_ip }}'
etc_hosts:
enneesseuno.ethiclab.it: '{{ pdns_master_ip }}'
enneessedue.ethiclab.it: '{{ pdns_slave_ip }}'
volumes:
- /etc/localtime:/etc/localtime:ro
published_ports:
- '53:53'
- '53:53/udp'
- '8081:8081'
env:
PDNS_gmysql_password: 'my-secret-pw'
PDNS_master: 'yes'
PDNS_dnsupdate: 'yes'
PDNS_allow-dnsupdate-from: '172.5.0.0/16 79.7.127.166/32'
PDNS_api: 'yes'
PDNS_api_key: 'secret'
PDNS_webserver: 'yes'
PDNS_webserver_address: '0.0.0.0'
PDNS_webserver_allow_from: '172.5.0.0/16'
PDNS_version_string: 'anonymous'
PDNS_default_ttl: '1500'
PDNS_soa_minimum_ttl: '1200'
PDNS_default_soa_name: 'enneesseuno.ethiclab.it'
PDNS_default_soa_mail: 'hostmaster.ethiclab.it'
PDNS_allow_axfr_ips: '{{ pdns_slave_ip }}'
PDNS_only_notify: '{{ pdns_slave_ip }}'
tags:
- pdns
- name: pdns slave
docker_container:
name: pdns-slave
image: pschiffe/pdns-mysql:{{ "alpine" if alpine | bool else "latest" }}
state: '{{ c_state }}'
hostname: enneessedue.ethiclab.it
networks_cli_compatible: true
networks:
- name: pdns-net
ipv4_address: '{{ pdns_slave_ip }}'
etc_hosts:
enneesseuno.ethiclab.it: '{{ pdns_master_ip }}'
enneessedue.ethiclab.it: '{{ pdns_slave_ip }}'
volumes:
- /etc/localtime:/etc/localtime:ro
env:
PDNS_gmysql_dbname: 'powerdnsslave'
PDNS_gmysql_password: 'my-secret-pw'
PDNS_slave: 'yes'
PDNS_superslave: 'yes'
PDNS_webserver: 'yes'
PDNS_webserver_address: '0.0.0.0'
PDNS_webserver_allow_from: '172.5.0.0/16'
PDNS_version_string: 'anonymous'
PDNS_disable_axfr: 'yes'
PDNS_allow_notify_from: '{{ pdns_master_ip }}'
SUPERMASTER_IPS: '{{ pdns_master_ip }}'
tags:
- pdns
- name: build pdns-admin base
docker_image:
name: pschiffe/pdns-admin-base
tag: ngoduykhanh
state: '{{ i_state }}'
source: build
force_source: true
build:
pull: true
path: ./pdns-admin-base-ngoduykhanh
tags:
- pdns-admin
- name: build pdns-admin backend
docker_image:
name: pschiffe/pdns-admin-uwsgi
tag: ngoduykhanh
state: '{{ i_state }}'
source: build
force_source: true
build:
pull: false
path: ./pdns-admin-uwsgi-ngoduykhanh
tags:
- pdns-admin
- name: build pdns-admin frontent
docker_image:
name: pschiffe/pdns-admin-static
tag: ngoduykhanh
state: '{{ i_state }}'
source: build
force_source: true
build:
pull: false
path: ./pdns-admin-static-ngoduykhanh
tags:
- pdns-admin
- name: pdns-admin backend
docker_container:
name: pdns-admin-uwsgi
image: pschiffe/pdns-admin-uwsgi:ngoduykhanh
state: '{{ c_state }}'
networks_cli_compatible: true
networks:
- name: pdns-net
aliases:
- pdns-admin-uwsgi
volumes:
- /etc/localtime:/etc/localtime:ro
env:
PDNS_ADMIN_SQLA_DB_PASSWORD: "'my-secret-pw'"
PDNS_VERSION: "4.2"
PDNS_API_KEY: "secret"
tags:
- pdns-admin
- name: pdns-admin frontend
docker_container:
name: pdns-admin-static
image: pschiffe/pdns-admin-static:ngoduykhanh
state: '{{ c_state }}'
networks_cli_compatible: true
networks:
- name: pdns-net
published_ports:
- '8889:80'
volumes:
- /etc/localtime:/etc/localtime:ro
tags:
- pdns-admin
- name: remove docker volumes
command: docker volume rm pdns-mariadb-volume
ignore_errors: true
when: wipe | bool
- name: remove network
docker_network:
name: pdns-net
state: absent
ignore_errors: true
when: wipe | bool