Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions Ansible/roles/marvin/files/powerdns-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
services:

mysql:
image: mysql:8.0
container_name: pdns-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: pdns
MYSQL_USER: pdns
MYSQL_PASSWORD: pdnspassword
Comment on lines +8 to +11
command: --default-authentication-plugin=mysql_native_password
volumes:
- mysql_data:/var/lib/mysql
networks:
- pdns-net
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "pdns", "-ppdnspassword"]
interval: 10s
timeout: 5s
retries: 10

pdns:
image: pschiffe/pdns-mysql:latest
container_name: pdns
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
ports:
- "53:53/udp"
- "53:53/tcp"
- "8081:8081"
environment:
PDNS_gmysql_host: mysql
PDNS_gmysql_port: 3306
PDNS_gmysql_dbname: pdns
PDNS_gmysql_user: pdns
PDNS_gmysql_password: pdnspassword
PDNS_api: "yes"
PDNS_api_key: supersecretapikey
PDNS_webserver: "yes"
PDNS_webserver_address: "0.0.0.0"
PDNS_webserver_port: 8081
PDNS_webserver_allow_from: "0.0.0.0/0"
PDNS_primary: "yes"
PDNS_default_ttl: 3600
PDNS_default_soa_content: "ns1.cloud.internal admin.cloud.internal 1 3600 900 1209600 300"
PDNS_default_soa_edit: "INCEPTION-INCREMENT"
networks:
- pdns-net

pdns-admin:
image: ngoduykhanh/powerdns-admin:latest
container_name: pdns-admin
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
pdns:
condition: service_started
ports:
- "9191:80"
environment:
SECRET_KEY: "ReplaceWithARandomString"
PDNS_API_URL: "http://pdns:8081/api/v1"
PDNS_API_KEY: "supersecretapikey"
PDNS_VERSION: "4.8"
GUNICORN_TIMEOUT: "120"
GUNICORN_WORKERS: "2"
volumes:
- pdns_admin_data:/app/data
networks:
- pdns-net

volumes:
mysql_data:
pdns_admin_data:

networks:
pdns-net:
62 changes: 62 additions & 0 deletions Ansible/roles/marvin/tasks/install_marvin_prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
dnf: name={{ item }} state=installed
with_items:
- at
- bind-utils
- bzip2-devel
- git
- jq
Expand Down Expand Up @@ -123,3 +124,64 @@
name: atd
state: started
enabled: true

- name: Ensure nftables dependencies are correct
dnf:
name:
- nftables
- libnftnl
state: latest
tags:
- marvin
- marvin_install

- name: Install Docker dependency packages
dnf:
name:
- dnf-plugins-core
- device-mapper-persistent-data
- lvm2
state: present
tags:
- marvin
- marvin_install

- name: Configure Docker CE repository
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
mode: "0644"
validate_certs: no
tags:
- marvin
- marvin_install

- name: Install Docker Engine and related components
dnf:
name:
- containerd.io
- docker-ce
- docker-ce-cli
- docker-buildx-plugin
- docker-compose-plugin
state: present
tags:
- marvin
- marvin_install

- name: Ensure Docker service is enabled and running
systemd:
name: docker
enabled: true
state: started
tags:
- marvin
- marvin_install

- name: Wait for Docker socket
wait_for:
path: /var/run/docker.sock
timeout: 30
tags:
- marvin
- marvin_install
21 changes: 21 additions & 0 deletions Ansible/roles/marvin/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,27 @@
- marvin
- marvin_cfg

- name: Create PDNS directory inside Marvin
file:
path: /marvin/pdns
state: directory
mode: '0755'
tags:
- marvin

- name: Copy PowerDNS compose file to VM
copy:
src: powerdns-docker-compose.yml
dest: /marvin/pdns/docker-compose.yml
mode: '0644'
tags:
- marvin

- name: Pre-pull Docker images for PowerDNS
shell: docker compose pull
args:
chdir: /marvin/pdns

Comment on lines +119 to +123
Comment thread
sudo87 marked this conversation as resolved.
- name: Retrieve cloud SSH keys from mgmt server
shell: "sshpass -p '{{ hostvars[groups['primary_cs_manager'][0]]['ansible_ssh_pass'] }}' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@{{ hostvars[groups['primary_cs_manager'][0]]['ansible_ssh_host'] }}:/usr/share/cloudstack-common/scripts/vm/systemvm/id_rsa.cloud ~/.ssh/id_rsa.cloud"
tags:
Expand Down