forked from dzervas/powerdns-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ansible-install.yml
59 lines (53 loc) · 1.54 KB
/
ansible-install.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
---
# Usage: ansible-playbook --extra-vars "domain=mydomain.org subdomain=mysubdomain.noflag.org.uk" add-wordpress-vhost.yml
- hosts: dnsmaster
become: true
vars_files:
- pdns-api.yml
tasks:
- name: Install powerdns master and admin panel
docker_service:
project_src: "{{ playbook_dir }}"
environment:
API_KEY: "{{ pdns_key }}"
WEBSERVER_PASSWORD: "{{ webserver_password }}"
ADMIN_PASSWORD: "{{ admin_password }}"
- name: Copy convenience scripts to host
copy:
src: "bin/{{ item }}"
dest: /usr/local/bin
mode: 0744
with_items:
- create-pdns-admin.sh
- pdns-cli.sh
- include: tasks/add-ns-records.yml
vars:
- kind: master
- include: add-dns-records.yml
with_items:
- powerdns
- dnsadmin
- cockpit
- hosts: dnsslaves
become: true
vars_files:
- pdns-api.yml
tasks:
- name: Install powerdns slave
docker_service:
project_src: "{{ playbook_dir }}"
files: docker-compose-slave
environment:
MASTER_IP: "{{ hostvars[groups['dnsmaster'][0]]['ansible_eth0']['ipv4']['address'] }}"
MASTER_DNS: "{{ hostvars[groups['dnsmaster'][0]]['inventory_hostname'] }}"
API_KEY: "{{ pdns_key }}"
- name: Copy convenience scripts to host
copy:
src: "bin/{{ item }}"
dest: /usr/local/bin
mode: 0744
with_items:
- pdns-cli.sh
- include: tasks/add-ns-records.yml
vars:
- kind: slave