From a4243e804e1e5e43178bcbdddacbbe7cdff64217 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 21 Jun 2021 14:37:59 +0200 Subject: [PATCH] Fixes to the powerdns-admin role. --- library/roles/powerdns-admin/defaults/main.yml | 3 +++ library/roles/powerdns-admin/meta/main.yml | 11 +++++++++-- library/roles/powerdns-admin/tasks/main.yml | 9 +++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/library/roles/powerdns-admin/defaults/main.yml b/library/roles/powerdns-admin/defaults/main.yml index f26f2ab..8bfdbc4 100644 --- a/library/roles/powerdns-admin/defaults/main.yml +++ b/library/roles/powerdns-admin/defaults/main.yml @@ -1,6 +1,9 @@ --- pdns_admin_install: True +# Use 'HEAD' to fetch the latest code +pdns_admin_version: 'v0.2.3' # Set it manually from the command line when you want to upgrade +# -e "pdns_admin_upgrade=True" pdns_admin_upgrade: False pdns_admin_dir: 'pdns_admin-{{ pdns_admin_version }}.linux-amd64' pdns_admin_git_repo_url: 'https://github.com/ngoduykhanh/PowerDNS-Admin.git' diff --git a/library/roles/powerdns-admin/meta/main.yml b/library/roles/powerdns-admin/meta/main.yml index a01845c..24286ea 100644 --- a/library/roles/powerdns-admin/meta/main.yml +++ b/library/roles/powerdns-admin/meta/main.yml @@ -1,5 +1,12 @@ --- dependencies: - - { role: '../../library/roles/postgresql', when: pdns_admin_local_pgsql | bool } - - role: '../../library/roles/nginx' + - src: git+https://gitea-s2i2s.isti.cnr.it/ISTI-ansible-roles/ansible-role-postgresql.git + version: master + name: postgresql + state: latest + when: pdns_admin_local_pgsql + - src: git+https://gitea-s2i2s.isti.cnr.it/ISTI-ansible-roles/ansible-role-nginx.git + version: master + name: nginx + state: latest - role: '../../library/roles/node_js' diff --git a/library/roles/powerdns-admin/tasks/main.yml b/library/roles/powerdns-admin/tasks/main.yml index 2c33008..e7f5973 100644 --- a/library/roles/powerdns-admin/tasks/main.yml +++ b/library/roles/powerdns-admin/tasks/main.yml @@ -17,18 +17,19 @@ apt: pkg={{ pdns_admin_prereqs }} state=present update_cache=yes cache_valid_time=1800 - name: Clone pdns_admin - git: repo={{ pdns_admin_git_repo_url }} dest={{ pdns_admin_home }} update=no + git: repo={{ pdns_admin_git_repo_url }} version={{ pdns_admin_version }} dest={{ pdns_admin_home }} update=no + when: not pdns_admin_upgrade - name: Force the clone and upgrade pdns_admin when updating - git: repo={{ pdns_admin_git_repo_url }} dest={{ pdns_admin_home }} update=yes force=yes - when: pdns_admin_upgrade | bool + git: repo={{ pdns_admin_git_repo_url }} version={{ pdns_admin_version }} dest={{ pdns_admin_home }} update=yes force=yes + when: pdns_admin_upgrade - name: Remove the files that we use to skip the initialisation commands file: dest={{ item }} state=absent with_items: - '{{ pdns_admin_logdir }}/.db_initialised' - '{{ pdns_admin_home }}/app/static/generated/login.js' - when: pdns_admin_upgrade | bool + when: pdns_admin_upgrade - name: Make the upload directory writeable by the pdnsadmin user file: dest={{ pdns_admin_home }}/upload recurse=yes owner={{ pdns_admin_user }} group={{ pdns_admin_user }} -- 2.17.1