Merge pull request 'Fixes to the powerdns-admin role.' (#234) from adellam/ansible-roles:master into master

Reviewed-on: #234
This commit is contained in:
Andrea Dell'Amico 2021-06-21 14:38:56 +02:00
commit a66c06b5ff
3 changed files with 17 additions and 6 deletions

View File

@ -1,6 +1,9 @@
--- ---
pdns_admin_install: True 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 # Set it manually from the command line when you want to upgrade
# -e "pdns_admin_upgrade=True"
pdns_admin_upgrade: False pdns_admin_upgrade: False
pdns_admin_dir: 'pdns_admin-{{ pdns_admin_version }}.linux-amd64' pdns_admin_dir: 'pdns_admin-{{ pdns_admin_version }}.linux-amd64'
pdns_admin_git_repo_url: 'https://github.com/ngoduykhanh/PowerDNS-Admin.git' pdns_admin_git_repo_url: 'https://github.com/ngoduykhanh/PowerDNS-Admin.git'

View File

@ -1,5 +1,12 @@
--- ---
dependencies: dependencies:
- { role: '../../library/roles/postgresql', when: pdns_admin_local_pgsql | bool } - src: git+https://gitea-s2i2s.isti.cnr.it/ISTI-ansible-roles/ansible-role-postgresql.git
- role: '../../library/roles/nginx' 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' - role: '../../library/roles/node_js'

View File

@ -17,18 +17,19 @@
apt: pkg={{ pdns_admin_prereqs }} state=present update_cache=yes cache_valid_time=1800 apt: pkg={{ pdns_admin_prereqs }} state=present update_cache=yes cache_valid_time=1800
- name: Clone pdns_admin - 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 - 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 git: repo={{ pdns_admin_git_repo_url }} version={{ pdns_admin_version }} dest={{ pdns_admin_home }} update=yes force=yes
when: pdns_admin_upgrade | bool when: pdns_admin_upgrade
- name: Remove the files that we use to skip the initialisation commands - name: Remove the files that we use to skip the initialisation commands
file: dest={{ item }} state=absent file: dest={{ item }} state=absent
with_items: with_items:
- '{{ pdns_admin_logdir }}/.db_initialised' - '{{ pdns_admin_logdir }}/.db_initialised'
- '{{ pdns_admin_home }}/app/static/generated/login.js' - '{{ 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 - 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 }} file: dest={{ pdns_admin_home }}/upload recurse=yes owner={{ pdns_admin_user }} group={{ pdns_admin_user }}