Added Powerdns-Admin Task and Playbook Entry

This commit is contained in:
Aeris 2019-02-01 07:41:04 +01:00
parent 7e71748c27
commit df96ffb214
10 changed files with 146 additions and 15 deletions

View file

@ -1,2 +1,5 @@
[servers] [mail]
club_mail club_mail
[docker]
club_docker

View file

@ -1,5 +1,10 @@
--- ---
- hosts: servers - hosts: mail
become: yes become: yes
roles: roles:
- { role: mailserver } - { role: mailserver }
- hosts: docker
become: yes
roles:
- { role: powerdns-admin }

View file

@ -57,6 +57,11 @@
dest: "{{ docker_data_folder }}/mailserver/mailman/core" dest: "{{ docker_data_folder }}/mailserver/mailman/core"
src: mailman/mailman-extra.cfg src: mailman/mailman-extra.cfg
- name: Copy mailman folder
file:
name: "{{ docker_project_folder }}/mailserver/mailman"
state: directory
- name: Copy Mailman Settings - name: Copy Mailman Settings
template: template:
src: settings_local.py.j2 src: settings_local.py.j2

View file

@ -142,7 +142,7 @@ services:
volumes: volumes:
- {{ docker_data_folder }}/mailserver/db:/var/lib/mysql - {{ docker_data_folder }}/mailserver/db:/var/lib/mysql
- ./db/docker-entrypoint.sh:/docker-entrypoint.sh - ./db/docker-entrypoint.sh:/docker-entrypoint.sh
- {{ docker_project_folder }}/mailserver/db:/docker-entrypoint-initdb.d #- {{ docker_project_folder }}/mailserver/db:/docker-entrypoint-initdb.d
labels: labels:
- "traefik.enable=false" - "traefik.enable=false"
@ -150,6 +150,7 @@ services:
image: maxking/mailman-core:latest image: maxking/mailman-core:latest
container_name: mailman-core container_name: mailman-core
hostname: mailman-core hostname: mailman-core
restart: always
volumes: volumes:
- {{ docker_data_folder }}/mailserver/mailman/core:/opt/mailman/ - {{ docker_data_folder }}/mailserver/mailman/core:/opt/mailman/
#- ./mailman/mailman-extra.cfg:/opt/mailman/core/mailman-extra.cfg #- ./mailman/mailman-extra.cfg:/opt/mailman/core/mailman-extra.cfg
@ -176,6 +177,7 @@ services:
image: maxking/mailman-web:latest image: maxking/mailman-web:latest
container_name: mailman-web container_name: mailman-web
hostname: mailman-web hostname: mailman-web
restart: always
expose: expose:
- 8000 - 8000
- 8080 - 8080
@ -240,7 +242,7 @@ services:
container_name: extractor container_name: extractor
image: danielhuisman/traefik-certificate-extractor image: danielhuisman/traefik-certificate-extractor
volumes: volumes:
- {{ docker_data_folder }}/mailserver/traefik:/app/data - ./traefik:/app/data
- certs:/app/certs_flat - certs:/app/certs_flat
labels: labels:
- "traefik.enable=false" - "traefik.enable=false"

View file

@ -3,7 +3,7 @@ become_method: sudo
ansible_ask_become_pass: yes ansible_ask_become_pass: yes
docker_data_folder: /data docker_data_folder: /data
docker_project_folder: /var/docker docker_project_folder: /var/docker
DOMAIN: creditcards.bayern DOMAIN: chaospott.de
mailman_sender_address: "lists@{{ DOMAIN }}" mailman_sender_address: "lists@{{ DOMAIN }}"
# vault # vault

View file

@ -1,11 +1,11 @@
$ANSIBLE_VAULT;1.1;AES256 $ANSIBLE_VAULT;1.1;AES256
61343433613065613963336562373266343631613831386333316564393132373861383730383131 38323634333837333739306133393564656139313838356665316538303637396231326138306539
6136663533343330363131623433333535616230343433650a373438373732636461386362656638 6262393237373431303633316663306636376230383635630a353338396662613831373739313636
32653463663136353363666230323930633866323239636238323831316235303432636332383732 63663062373032383932313432346131653361653638646164303366316435323735643339303661
6563333066313533360a353639353935316531353763663434613463303439346162373431343134 3533633737373737630a646664623536303565313165643538643535626537353365656536316135
37383761616466333938393165653935653565336434303835373239643962336161613363626534 39303630346361383337656431666265313631626662393166346161616539373436393965383134
34303037363634666332396635616231383462383230656530343036346164333265636637303237 62313366373136396531393431623739626331356131333837613437333536656237613065363661
31633839383031376137376136383738656639616666326637303532613735653734396630333838 34316634326139303835623439353033613738336564363262653938306639623931633339336334
36643465636439323364646362323164333563333131333666666564646466633736633137363430 66323666363765663238633063363163663361643064623438303331393930306464333661626162
66363765376364306366353664356131623136646134613532623532346362646661346365323135 64373834303438323036313865396236616438663664343539386632343164613063313161313032
6431643536393461313632613335626532306561333836643534 3432336232396637363663653361336663343464396632613461

View file

@ -0,0 +1,81 @@
version: "2.1"
services:
powerdns-admin:
build:
context: .
dockerfile: docker/PowerDNS-Admin/Dockerfile
args:
- ENVIRONMENT=development
image: powerdns-admin
container_name: powerdns-admin
mem_limit: 256M
restart: always
memswap_limit: 256M
ports:
- "9191:9191"
labels:
- "traefik.frontend.rule=Host:dns.chaospott.de"
- "traefik.port=9191"
- "traefik.frontend.passHostHeader=true"
volumes:
# Code
- ".:/powerdns-admin/"
- "./configs/development.py:/powerdns-admin/config.py"
# Assets dir volume
- powerdns-admin-assets:/powerdns-admin/app/static
- powerdns-admin-assets2:/powerdns-admin/node_modules
- powerdns-admin-assets3:/powerdns-admin/logs
- ./app/static/custom:/powerdns-admin/app/static/custom
logging:
driver: json-file
options:
max-size: 50m
networks:
- default
environment:
- ENVIRONMENT=development
- PDA_DB_HOST=powerdns-admin-mysql
- PDA_DB_NAME=powerdns_admin
- PDA_DB_USER=powerdns_admin
- PDA_DB_PASSWORD={{ db_password }}
- PDA_DB_PORT=3306
- PDNS_HOST=192.168.122.1
- PDNS_API_KEY={{ api_key }}
- FLASK_APP=/powerdns-admin/app/__init__.py
depends_on:
powerdns-admin-mysql:
condition: service_healthy
powerdns-admin-mysql:
image: mysql/mysql-server:5.7
hostname: ${PDA_DB_HOST}
container_name: powerdns-admin-mysql
mem_limit: 256M
memswap_limit: 256M
restart: always
expose:
- 3306
volumes:
- /data/powerdns:/var/lib/mysql
labels:
- "traefik.enable=false"
environment:
- MYSQL_DATABASE=powerdns_admin
- MYSQL_USER=powerdns_admin
- MYSQL_PASSWORD={{ db_password }}
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 10s
retries: 5
networks:
default:
external:
name: web
volumes:
powerdns-admin-assets:
powerdns-admin-assets2:
powerdns-admin-assets3:

View file

@ -0,0 +1,12 @@
ENVIRONMENT=development
PDA_DB_HOST=powerdns-admin-mysql
PDA_DB_NAME=powerdns_admin
PDA_DB_USER=powerdns_admin
PDA_DB_PASSWORD={{ db_password }}
PDA_DB_PORT=3306
PDNS_HOST=192.168.122.1
PDNS_API_KEY={{ api_key }}
PDNS_WEBSERVER_ALLOW_FROM=0.0.0.0

View file

@ -0,0 +1,14 @@
- name: Clone Pdns Git
git:
repo: 'https://github.com/ngoduykhanh/PowerDNS-Admin/'
dest: /root/docker
- name: replace docker compose
template:
src: docker-compose.yml
dest: "/root/docker/PowerDNS-Admin/docker-compose.yml"
- name: start Powerdns-docker
docker_service:
project_src: "/root/docker/PowerDNS-Admin"
pull: yes

View file

@ -0,0 +1,9 @@
$ANSIBLE_VAULT;1.1;AES256
63363935373961613464626337643630323433356663353132613661313134643433636361623862
3964666563633539316636383138383138643735643330340a353934346135656231333934616130
36363630313736613735393437343736373332323432343832666539653535356332363463353364
3437363336386463640a643163663135666231613034303366316566616339663164663136373466
31633532323861366530306332373134333839366232656262343034376638303065373735336163
32653133333530336438336533323930346631653734346435326362333032393261313430656430
37373535623962623038626433366438343165373864633832336639643134643133313238353332
30333565313766373631