Enhancement: Structure
This commit is contained in:
parent
ea74e0b246
commit
2b6c1ed108
5 changed files with 22 additions and 20 deletions
|
|
@ -1,25 +1,28 @@
|
|||
---
|
||||
- vars:
|
||||
zone_config_file: "{{ dns.patch.etc }}/named.conf.{{ zone.domain_name }}"
|
||||
zone_db_file: "{{ dns.patch.primary_zones }}/db.{{ zone.domain_name }}.zone"
|
||||
- name: "Setting facts for zone {{ item.zone.domain_name }}"
|
||||
ansible.builtin.set_fact:
|
||||
zone_config_file: "{{ dns.paths.etc }}/named.conf.{{ item.zone.domain_name }}"
|
||||
zone_db_file: "{{ dns.paths.primary_zones }}/db.{{ item.zone.domain_name }}.zone"
|
||||
domain_name: "{{ item.zone.domain_name }}"
|
||||
|
||||
- name: Updating primary zone db file
|
||||
ansible.builtin.file:
|
||||
src: "file/ns/zone/db.{{ zone.domain_name }}"
|
||||
ansible.builtin.copy:
|
||||
src: "tasks/ns/files/db.{{ domain_name }}.zone"
|
||||
dest: "{{ zone_db_file }}"
|
||||
mode: "644"
|
||||
|
||||
- name: "Creating zone {{ domain_name }}"
|
||||
ansible.builtin.template:
|
||||
src: templates/ns/zone/named.conf.primary-zone.j2
|
||||
src: tasks/ns/templates/named.conf.primary-zone.j2
|
||||
dest: "{{ zone_config_file }}"
|
||||
mode: "644"
|
||||
|
||||
- name: "Including zone configuration to global configuration"
|
||||
ansible.builtin.blockinfile:
|
||||
path: "{{ dns.path.etc }}/named.conf.local"
|
||||
path: "{{ dns.paths.etc }}/named.conf.local"
|
||||
state: present
|
||||
marker: "// {mark} ANSIBLE MANAGED BLOCK FOR {{ domain_name }} ZONE"
|
||||
block: |
|
||||
"include \"{{ zone_config_file }}\"";
|
||||
include "{{ zone_config_file }}";
|
||||
marker_begin: BEGIN
|
||||
marker_end: END
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue