aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2022-01-14 15:37:07 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2022-01-14 15:37:07 +0100
commit41a475c5fb12d0bb82d596331796b8f375904c0a (patch)
tree8d1a92a0a7a996a3123282146a81818eef0a9d36
parentb3dd8a8870aed158af36042359d224d350f1b39e (diff)
downloadansible_collection-41a475c5fb12d0bb82d596331796b8f375904c0a.tar.gz
bind: add file zonefile source
-rw-r--r--galaxy.yml2
-rw-r--r--roles/bind/defaults/main.yml1
-rw-r--r--roles/bind/tasks/download_zonefile.yml10
3 files changed, 12 insertions, 1 deletions
diff --git a/galaxy.yml b/galaxy.yml
index 5ce7984..e8e52bc 100644
--- a/galaxy.yml
+++ b/galaxy.yml
@@ -1,6 +1,6 @@
namespace: kompetenzbolzen
name: stuff
-version: 0.8.2
+version: 0.8.3
readme: README.md
authors:
- Jonas Gunz <himself@jonasgunz.de>
diff --git a/roles/bind/defaults/main.yml b/roles/bind/defaults/main.yml
index bd90082..f242706 100644
--- a/roles/bind/defaults/main.yml
+++ b/roles/bind/defaults/main.yml
@@ -1,4 +1,5 @@
---
bind_zones: []
bind_zonefile_base_url: ''
+bind_zonefile_base_folder: ''
bind_install_zonefiles: false
diff --git a/roles/bind/tasks/download_zonefile.yml b/roles/bind/tasks/download_zonefile.yml
index 9e89507..9c0f4ac 100644
--- a/roles/bind/tasks/download_zonefile.yml
+++ b/roles/bind/tasks/download_zonefile.yml
@@ -5,6 +5,7 @@
return_content: yes
delegate_to: localhost
register: zonefile
+ when: bind_zonefile_base_url != ""
- name: Install zonefile
copy:
@@ -12,4 +13,13 @@
content: '{{ zonefile.content }}'
become: yes
notify: Restart bind
+ when: bind_zonefile_base_url != ""
+
+- name: Copy zonefile
+ copy:
+ src: '{{ bind_zonefile_base_folder }}/{{ item }}'
+ dest: '/etc/bind/zonefiles/{{ item }}'
+ become: yes
+ notify: Restart bind
+ when: bind_zonefile_base_folder != ""