2016-09-02 22:48:20 +02:00
|
|
|
---
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: PDNS
|
|
|
|
hosts: localhost
|
2016-09-02 22:48:20 +02:00
|
|
|
vars:
|
|
|
|
pdns_master_ip: 172.5.0.20
|
|
|
|
pdns_slave_ip: 172.5.0.21
|
2017-08-21 21:31:23 +02:00
|
|
|
wipe: false
|
|
|
|
c_state: '{{ "absent" if wipe | bool else "started" }}'
|
|
|
|
i_state: present
|
2018-11-07 00:50:59 +01:00
|
|
|
alpine: false
|
2017-08-21 21:31:23 +02:00
|
|
|
tasks:
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Create docker network
|
|
|
|
community.docker.docker_network:
|
2017-08-21 21:31:23 +02:00
|
|
|
name: pdns-net
|
|
|
|
state: present
|
2020-01-03 18:02:39 +01:00
|
|
|
ipam_config:
|
|
|
|
- subnet: '172.5.0.0/16'
|
|
|
|
gateway: '172.5.0.1'
|
|
|
|
tags:
|
|
|
|
- pdns
|
|
|
|
- pdns-admin
|
|
|
|
- pdns-recursor
|
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Build pdns recursor
|
|
|
|
community.docker.docker_image:
|
2020-01-08 01:09:01 +01:00
|
|
|
name: pschiffe/pdns-recursor
|
2020-01-03 18:02:39 +01:00
|
|
|
state: '{{ i_state }}'
|
|
|
|
source: build
|
|
|
|
force_source: true
|
|
|
|
build:
|
|
|
|
pull: true
|
|
|
|
path: ./pdns-recursor
|
|
|
|
tags:
|
|
|
|
- pdns-recursor
|
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Build pdns recursor alpine version
|
|
|
|
community.docker.docker_image:
|
2020-01-08 01:09:01 +01:00
|
|
|
name: pschiffe/pdns-recursor
|
2020-01-03 18:02:39 +01:00
|
|
|
tag: alpine
|
|
|
|
state: '{{ i_state }}'
|
|
|
|
source: build
|
|
|
|
force_source: true
|
|
|
|
build:
|
|
|
|
pull: true
|
|
|
|
path: ./pdns-recursor
|
|
|
|
dockerfile: Dockerfile.alpine
|
|
|
|
tags:
|
|
|
|
- pdns-recursor
|
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: PDNS recursor
|
|
|
|
community.docker.docker_container:
|
2020-01-03 18:02:39 +01:00
|
|
|
name: pdns-recursor
|
2020-01-08 01:09:01 +01:00
|
|
|
image: pschiffe/pdns-recursor:{{ "alpine" if alpine | bool else "latest" }}
|
2020-01-03 18:02:39 +01:00
|
|
|
state: '{{ c_state }}'
|
|
|
|
networks:
|
|
|
|
- name: pdns-net
|
|
|
|
volumes:
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
2023-12-17 02:39:45 +01:00
|
|
|
ulimits:
|
|
|
|
- 'nofile:5000:5000'
|
2020-01-03 18:02:39 +01:00
|
|
|
tags:
|
|
|
|
- pdns-recursor
|
2016-09-02 22:48:20 +02:00
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: DB
|
|
|
|
community.docker.docker_container:
|
2017-08-21 21:31:23 +02:00
|
|
|
name: pdns-mariadb
|
2023-12-17 02:39:45 +01:00
|
|
|
image: mariadb:11
|
2017-08-21 21:31:23 +02:00
|
|
|
pull: true
|
|
|
|
state: '{{ c_state }}'
|
|
|
|
networks:
|
|
|
|
- name: pdns-net
|
|
|
|
aliases:
|
|
|
|
- db
|
|
|
|
- mysql
|
|
|
|
volumes:
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
- pdns-mariadb-volume:/var/lib/mysql:z
|
|
|
|
env:
|
2020-01-03 18:02:39 +01:00
|
|
|
MYSQL_ROOT_PASSWORD: 'my-secret-pw'
|
2021-01-22 18:13:04 +01:00
|
|
|
healthcheck:
|
2023-12-17 02:39:45 +01:00
|
|
|
test: ['CMD', 'healthcheck.sh', '--su=mysql', '--connect', '--innodb_initialized']
|
2021-01-22 18:13:04 +01:00
|
|
|
timeout: 10s
|
|
|
|
retries: 5
|
2017-08-21 21:31:23 +02:00
|
|
|
tags:
|
|
|
|
- db
|
2016-09-02 22:48:20 +02:00
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Phpmyadmin
|
|
|
|
community.docker.docker_container:
|
2017-08-21 21:31:23 +02:00
|
|
|
name: pdns-phpmyadmin
|
2023-01-15 17:06:10 +01:00
|
|
|
image: phpmyadmin:5
|
2017-08-21 21:31:23 +02:00
|
|
|
pull: true
|
|
|
|
state: '{{ c_state }}'
|
|
|
|
networks:
|
|
|
|
- name: pdns-net
|
|
|
|
published_ports:
|
|
|
|
- '8888:80'
|
|
|
|
volumes:
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
tags:
|
|
|
|
- db
|
2016-09-02 22:48:20 +02:00
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Build pdns
|
|
|
|
community.docker.docker_image:
|
2020-01-08 01:09:01 +01:00
|
|
|
name: pschiffe/pdns-mysql
|
2017-08-21 21:31:23 +02:00
|
|
|
state: '{{ i_state }}'
|
2020-01-03 18:02:39 +01:00
|
|
|
source: build
|
|
|
|
force_source: true
|
|
|
|
build:
|
|
|
|
pull: true
|
2024-01-02 20:09:28 +01:00
|
|
|
path: ./pdns-mysql
|
2017-08-21 21:31:23 +02:00
|
|
|
tags:
|
|
|
|
- pdns
|
2016-09-02 22:48:20 +02:00
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Build pdns alpine version
|
|
|
|
community.docker.docker_image:
|
2020-01-08 01:09:01 +01:00
|
|
|
name: pschiffe/pdns-mysql
|
2018-11-07 00:50:59 +01:00
|
|
|
tag: alpine
|
|
|
|
state: '{{ i_state }}'
|
2020-01-03 18:02:39 +01:00
|
|
|
source: build
|
|
|
|
force_source: true
|
|
|
|
build:
|
|
|
|
pull: true
|
2024-01-02 20:09:28 +01:00
|
|
|
path: ./pdns-mysql
|
2020-01-03 18:02:39 +01:00
|
|
|
dockerfile: Dockerfile.alpine
|
2018-11-07 00:50:59 +01:00
|
|
|
tags:
|
|
|
|
- pdns
|
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: PDNS master
|
|
|
|
community.docker.docker_container:
|
2017-08-21 21:31:23 +02:00
|
|
|
name: pdns
|
2020-01-08 01:09:01 +01:00
|
|
|
image: pschiffe/pdns-mysql:{{ "alpine" if alpine | bool else "latest" }}
|
2017-08-21 21:31:23 +02:00
|
|
|
state: '{{ c_state }}'
|
|
|
|
hostname: ns1.example.com
|
|
|
|
networks:
|
|
|
|
- name: pdns-net
|
|
|
|
ipv4_address: '{{ pdns_master_ip }}'
|
|
|
|
etc_hosts:
|
|
|
|
ns1.example.com: '{{ pdns_master_ip }}'
|
|
|
|
ns2.example.com: '{{ pdns_slave_ip }}'
|
|
|
|
volumes:
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
env:
|
2020-01-03 18:02:39 +01:00
|
|
|
PDNS_gmysql_password: 'my-secret-pw'
|
|
|
|
PDNS_master: 'yes'
|
|
|
|
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'
|
2017-08-21 21:31:23 +02:00
|
|
|
PDNS_allow_axfr_ips: '{{ pdns_slave_ip }}'
|
|
|
|
PDNS_only_notify: '{{ pdns_slave_ip }}'
|
|
|
|
tags:
|
|
|
|
- pdns
|
2016-09-02 22:48:20 +02:00
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: PDNS slave
|
|
|
|
community.docker.docker_container:
|
2017-08-21 21:31:23 +02:00
|
|
|
name: pdns-slave
|
2020-01-08 01:09:01 +01:00
|
|
|
image: pschiffe/pdns-mysql:{{ "alpine" if alpine | bool else "latest" }}
|
2017-08-21 21:31:23 +02:00
|
|
|
state: '{{ c_state }}'
|
|
|
|
hostname: ns2.example.com
|
|
|
|
networks:
|
|
|
|
- name: pdns-net
|
|
|
|
ipv4_address: '{{ pdns_slave_ip }}'
|
|
|
|
etc_hosts:
|
|
|
|
ns1.example.com: '{{ pdns_master_ip }}'
|
|
|
|
ns2.example.com: '{{ pdns_slave_ip }}'
|
|
|
|
volumes:
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
env:
|
2020-01-03 18:02:39 +01:00
|
|
|
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'
|
2017-08-21 21:31:23 +02:00
|
|
|
PDNS_allow_notify_from: '{{ pdns_master_ip }}'
|
|
|
|
SUPERMASTER_IPS: '{{ pdns_master_ip }}'
|
|
|
|
tags:
|
|
|
|
- pdns
|
2016-09-02 22:48:20 +02:00
|
|
|
|
2024-01-01 20:39:33 +01:00
|
|
|
- name: Build pdns-admin
|
2023-12-17 02:39:45 +01:00
|
|
|
community.docker.docker_image:
|
2024-01-01 20:39:33 +01:00
|
|
|
name: pschiffe/pdns-admin
|
2021-10-06 00:00:38 +02:00
|
|
|
tag: latest
|
2018-11-21 01:31:02 +01:00
|
|
|
state: '{{ i_state }}'
|
2020-01-03 18:02:39 +01:00
|
|
|
source: build
|
|
|
|
force_source: true
|
|
|
|
build:
|
|
|
|
pull: true
|
2024-01-01 20:39:33 +01:00
|
|
|
path: ./pdns-admin
|
2018-11-21 01:31:02 +01:00
|
|
|
tags:
|
|
|
|
- pdns-admin
|
|
|
|
|
2024-01-01 20:39:33 +01:00
|
|
|
- name: PDNS-admin
|
2023-12-17 02:39:45 +01:00
|
|
|
community.docker.docker_container:
|
2024-01-01 20:39:33 +01:00
|
|
|
name: pdns-admin
|
|
|
|
image: pschiffe/pdns-admin
|
2017-08-21 21:31:23 +02:00
|
|
|
state: '{{ c_state }}'
|
|
|
|
networks:
|
|
|
|
- name: pdns-net
|
|
|
|
aliases:
|
2024-01-01 20:39:33 +01:00
|
|
|
- pdns-admin
|
|
|
|
published_ports:
|
|
|
|
- '8889:8080'
|
2017-08-21 21:31:23 +02:00
|
|
|
volumes:
|
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
env:
|
2023-12-19 23:12:51 +01:00
|
|
|
PDNS_ADMIN_SQLA_DB_PASSWORD: 'my-secret-pw'
|
|
|
|
PDNS_VERSION: '4.8'
|
|
|
|
PDNS_API_KEY: 'secret'
|
2017-08-21 21:31:23 +02:00
|
|
|
tags:
|
|
|
|
- pdns-admin
|
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Remove docker volume
|
|
|
|
community.docker.docker_volume:
|
|
|
|
name: pdns-mariadb-volume
|
|
|
|
state: absent
|
2017-08-21 21:31:23 +02:00
|
|
|
when: wipe | bool
|
|
|
|
|
2023-12-17 02:39:45 +01:00
|
|
|
- name: Remove network
|
|
|
|
community.docker.docker_network:
|
2017-08-21 21:31:23 +02:00
|
|
|
name: pdns-net
|
|
|
|
state: absent
|
|
|
|
when: wipe | bool
|