From 54aa66e3c40e6b634aacbd3202ab33a9406bb4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 7 Sep 2025 20:51:12 +0300 Subject: [PATCH] Add PowerDNS Authorative database initialization task --- tasks/deployer.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tasks/deployer.yml b/tasks/deployer.yml index e2ee324..01b8d48 100644 --- a/tasks/deployer.yml +++ b/tasks/deployer.yml @@ -347,6 +347,26 @@ - powerdns-authorative - dns +- name: "Deployer - PowerDNS Authorative - Database - Initialize" + community.mysql.mysql_db: + login_host: "127.0.0.1" + login_user: "{{ config.mariadb.users['powerdns'].username }}" + login_password: "{{ config.mariadb.users['powerdns'].password }}" + name: "{{ config.mariadb.users['powerdns'].database }}" + state: import + target: ',/files/powerdns-authorative/schema.mysql.sql' + failed_when: true + when: + - (deployerTaskM2 is defined and deployerTaskM2.changed) or deployerTaskM2 is undefined + - config.mariadb.users is defined + - config.mariadb.users['powerdns'] is defined + - config.mariadb.users['powerdns'].username is defined + - config.mariadb.users['powerdns'].password is defined + - config.mariadb.users['powerdns'].database is defined + tags: + - powerdns-authorative + - dns + - name: "Deployer - PowerDNS Authorative - Pull Image" containers.podman.podman_image: name: docker.io/powerdns/pdns-auth-50