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"
|
||||
channels:
|
||||
- name: "security_file"
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "/var/log/named/security.log"
|
||||
options: "versions 3 size 30m"
|
||||
severity: "dynamic"
|
||||
@ -91,7 +91,7 @@ bind9_views: []
|
||||
# file: zones/external/db.local.example
|
||||
# origin: "example.local."
|
||||
# type: master
|
||||
# notify: yes
|
||||
# notify: true
|
||||
# - name: internal
|
||||
# match_clients:
|
||||
# - "!192.168.178.1"
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: restart named
|
||||
systemd:
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ bind_service_name }}"
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
@ -4,39 +4,39 @@
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: Install bind and dependencies
|
||||
package:
|
||||
ansible.builtin.package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ bind_package_names }}"
|
||||
|
||||
- name: Create logging directory
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ bind_log_directory }}"
|
||||
owner: "{{ bind_unix_user }}"
|
||||
group: "{{ bind_unix_group }}"
|
||||
mode: 0755
|
||||
state: directory
|
||||
recurse: yes
|
||||
recurse: true
|
||||
|
||||
- name: Create config directory
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ bind_config_directory }}"
|
||||
owner: "{{ bind_unix_user }}"
|
||||
group: "{{ bind_unix_group }}"
|
||||
mode: 0755
|
||||
state: directory
|
||||
recurse: yes
|
||||
recurse: true
|
||||
|
||||
- name: Remove existing journal files
|
||||
block:
|
||||
- name: find existing journal files
|
||||
find:
|
||||
path: "{{ bind_config_directory }}"
|
||||
recurse: yes
|
||||
recurse: true
|
||||
patterns: "*.jnl"
|
||||
register: files_to_delete
|
||||
- name: delete existing journal files
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.path }}"
|
||||
state: absent
|
||||
with_items: "{{ files_to_delete.files }}"
|
||||
@ -57,7 +57,7 @@
|
||||
loop_var: view
|
||||
|
||||
- name: Create main configuration file
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "etc/named.conf.j2"
|
||||
dest: "{{ bind_main_config }}"
|
||||
owner: "{{ bind_unix_user }}"
|
||||
@ -66,7 +66,7 @@
|
||||
notify: restart named
|
||||
|
||||
- name: Create excluded configuration files
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ item }}.j2"
|
||||
dest: "{{ item | replace('etc/named', bind_config_directory) }}"
|
||||
owner: "{{ bind_unix_user }}"
|
||||
@ -82,7 +82,7 @@
|
||||
notify: restart named
|
||||
|
||||
- name: Start and enabled named
|
||||
systemd:
|
||||
ansible.builtin.systemd:
|
||||
name: named
|
||||
state: started
|
||||
enabled: yes
|
||||
enabled: true
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
|
||||
- name: create directory for zone {{ zone.file | dirname }}
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
path: "{{ bind_config_directory }}/{{ zone.file | dirname }}"
|
||||
owner: "{{ bind_unix_user }}"
|
||||
group: "{{ bind_unix_group }}"
|
||||
@ -14,7 +14,7 @@
|
||||
when: zone.file is defined and zone.file | length > 0
|
||||
|
||||
- name: "template view {{ view.name }}"
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: "{{ inventory_hostname }}/etc/named/{{ zone.file }}.j2"
|
||||
dest: "{{ bind_config_directory }}/{{ zone.file }}"
|
||||
owner: "{{ bind_unix_user }}"
|
||||
@ -25,4 +25,4 @@
|
||||
loop_control:
|
||||
loop_var: zone
|
||||
when: zone.type == 'master'
|
||||
notify: restart named
|
||||
notify: restart named
|
||||
|
@ -10,4 +10,4 @@ bind_package_names:
|
||||
bind_service_name: named
|
||||
|
||||
bind_unix_user: bind
|
||||
bind_unix_group: bind
|
||||
bind_unix_group: bind
|
||||
|
@ -11,4 +11,4 @@ bind_package_names:
|
||||
bind_service_name: named
|
||||
|
||||
bind_unix_user: named
|
||||
bind_unix_group: named
|
||||
bind_unix_group: named
|
||||
|
Loading…
Reference in New Issue
Block a user