This commit is contained in:
parent
b7cba859e2
commit
6b8b178405
17
.yamllint.yaml
Normal file
17
.yamllint.yaml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#
|
||||||
|
# Documentation:
|
||||||
|
# https://yamllint.readthedocs.io/en/stable/
|
||||||
|
#
|
||||||
|
|
||||||
|
rules:
|
||||||
|
brackets:
|
||||||
|
forbid: false
|
||||||
|
min-spaces-inside: 0
|
||||||
|
max-spaces-inside: 2
|
||||||
|
min-spaces-inside-empty: 0
|
||||||
|
max-spaces-inside-empty: 0
|
||||||
|
indentation:
|
||||||
|
spaces: 2
|
||||||
|
indent-sequences: false
|
||||||
|
line-length:
|
||||||
|
max: 360
|
@ -12,7 +12,7 @@ bind9_logging:
|
|||||||
- "security_file"
|
- "security_file"
|
||||||
channels:
|
channels:
|
||||||
- name: "security_file"
|
- name: "security_file"
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "/var/log/named/security.log"
|
path: "/var/log/named/security.log"
|
||||||
options: "versions 3 size 30m"
|
options: "versions 3 size 30m"
|
||||||
severity: "dynamic"
|
severity: "dynamic"
|
||||||
@ -91,7 +91,7 @@ bind9_views: []
|
|||||||
# file: zones/external/db.local.example
|
# file: zones/external/db.local.example
|
||||||
# origin: "example.local."
|
# origin: "example.local."
|
||||||
# type: master
|
# type: master
|
||||||
# notify: yes
|
# notify: true
|
||||||
# - name: internal
|
# - name: internal
|
||||||
# match_clients:
|
# match_clients:
|
||||||
# - "!192.168.178.1"
|
# - "!192.168.178.1"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: restart named
|
- name: restart named
|
||||||
systemd:
|
ansible.builtin.systemd:
|
||||||
name: "{{ bind_service_name }}"
|
name: "{{ bind_service_name }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
|
@ -4,39 +4,39 @@
|
|||||||
include_vars: "{{ ansible_os_family }}.yml"
|
include_vars: "{{ ansible_os_family }}.yml"
|
||||||
|
|
||||||
- name: Install bind and dependencies
|
- name: Install bind and dependencies
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
with_items: "{{ bind_package_names }}"
|
with_items: "{{ bind_package_names }}"
|
||||||
|
|
||||||
- name: Create logging directory
|
- name: Create logging directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ bind_log_directory }}"
|
path: "{{ bind_log_directory }}"
|
||||||
owner: "{{ bind_unix_user }}"
|
owner: "{{ bind_unix_user }}"
|
||||||
group: "{{ bind_unix_group }}"
|
group: "{{ bind_unix_group }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
state: directory
|
state: directory
|
||||||
recurse: yes
|
recurse: true
|
||||||
|
|
||||||
- name: Create config directory
|
- name: Create config directory
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ bind_config_directory }}"
|
path: "{{ bind_config_directory }}"
|
||||||
owner: "{{ bind_unix_user }}"
|
owner: "{{ bind_unix_user }}"
|
||||||
group: "{{ bind_unix_group }}"
|
group: "{{ bind_unix_group }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
state: directory
|
state: directory
|
||||||
recurse: yes
|
recurse: true
|
||||||
|
|
||||||
- name: Remove existing journal files
|
- name: Remove existing journal files
|
||||||
block:
|
block:
|
||||||
- name: find existing journal files
|
- name: find existing journal files
|
||||||
find:
|
find:
|
||||||
path: "{{ bind_config_directory }}"
|
path: "{{ bind_config_directory }}"
|
||||||
recurse: yes
|
recurse: true
|
||||||
patterns: "*.jnl"
|
patterns: "*.jnl"
|
||||||
register: files_to_delete
|
register: files_to_delete
|
||||||
- name: delete existing journal files
|
- name: delete existing journal files
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item.path }}"
|
path: "{{ item.path }}"
|
||||||
state: absent
|
state: absent
|
||||||
with_items: "{{ files_to_delete.files }}"
|
with_items: "{{ files_to_delete.files }}"
|
||||||
@ -57,7 +57,7 @@
|
|||||||
loop_var: view
|
loop_var: view
|
||||||
|
|
||||||
- name: Create main configuration file
|
- name: Create main configuration file
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "etc/named.conf.j2"
|
src: "etc/named.conf.j2"
|
||||||
dest: "{{ bind_main_config }}"
|
dest: "{{ bind_main_config }}"
|
||||||
owner: "{{ bind_unix_user }}"
|
owner: "{{ bind_unix_user }}"
|
||||||
@ -66,7 +66,7 @@
|
|||||||
notify: restart named
|
notify: restart named
|
||||||
|
|
||||||
- name: Create excluded configuration files
|
- name: Create excluded configuration files
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "{{ item }}.j2"
|
src: "{{ item }}.j2"
|
||||||
dest: "{{ item | replace('etc/named', bind_config_directory) }}"
|
dest: "{{ item | replace('etc/named', bind_config_directory) }}"
|
||||||
owner: "{{ bind_unix_user }}"
|
owner: "{{ bind_unix_user }}"
|
||||||
@ -82,7 +82,7 @@
|
|||||||
notify: restart named
|
notify: restart named
|
||||||
|
|
||||||
- name: Start and enabled named
|
- name: Start and enabled named
|
||||||
systemd:
|
ansible.builtin.systemd:
|
||||||
name: named
|
name: named
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: true
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: create directory for zone {{ zone.file | dirname }}
|
- name: create directory for zone {{ zone.file | dirname }}
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ bind_config_directory }}/{{ zone.file | dirname }}"
|
path: "{{ bind_config_directory }}/{{ zone.file | dirname }}"
|
||||||
owner: "{{ bind_unix_user }}"
|
owner: "{{ bind_unix_user }}"
|
||||||
group: "{{ bind_unix_group }}"
|
group: "{{ bind_unix_group }}"
|
||||||
@ -14,7 +14,7 @@
|
|||||||
when: zone.file is defined and zone.file | length > 0
|
when: zone.file is defined and zone.file | length > 0
|
||||||
|
|
||||||
- name: "template view {{ view.name }}"
|
- name: "template view {{ view.name }}"
|
||||||
template:
|
ansible.builtin.template:
|
||||||
src: "{{ inventory_hostname }}/etc/named/{{ zone.file }}.j2"
|
src: "{{ inventory_hostname }}/etc/named/{{ zone.file }}.j2"
|
||||||
dest: "{{ bind_config_directory }}/{{ zone.file }}"
|
dest: "{{ bind_config_directory }}/{{ zone.file }}"
|
||||||
owner: "{{ bind_unix_user }}"
|
owner: "{{ bind_unix_user }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user