Merge branch 'master' of adellam/ansible-roles into master

This commit is contained in:
Andrea Dell'Amico 2019-08-05 18:15:03 +02:00 committed by Gitea
commit ea6af1eab8
6 changed files with 44 additions and 8 deletions

View File

@ -8,6 +8,31 @@ bind_pkg_list:
- '{{ bind_pkg_n }}-host'
- '{{ bind_pkg_n }}utils'
bind_user: bind
bind_group: bind
bind_config_path: '/etc/bind'
bind_cache_dir: '/var/cache/bind'
# RH/CentOS. We do not handle that yet
bind_use_chroot_on_rh: True
bind_chroot_base: /var/named/chroot
bind_service_enabled: True
bind_rh_config_path: '/etc'
bind_rh_user: named
bind_rh_group: named
bind_rh_packages:
- bind
- bind-license
- bind-utils
bind_rh_chroot_packages:
- bind-chroot
- bind-license
- bind-utils
# These options are meant for the caching nameserver configuration
bind_caching_nameserver: False
bind_allowed_query_acl:
- '{{ ansible_default_ipv4.address }}'
@ -19,7 +44,6 @@ bind_forwarders_list:
bind_listen_on_ipv4: True
bind_listen_on_ipv6:
- any
bind_cache_dir: /var/cache/bind
bind_dnssec_enabled: False
bind_dnssec_validation: auto
# Default: 1 week

View File

@ -0,0 +1,9 @@
---
- block:
- name: Install the bind caching configuration, we are going to run a caching nameserver
template: src=named.conf.caching-nameserver.options.j2 dest=/etc/bind/named.conf.options owner=root group=bind mode=0640
notify: reload bind
when: bind_enabled
tags: [ 'bind', 'caching_nameserver' ]

View File

@ -1,13 +1,9 @@
---
- block:
- name: Install the bind packages
- name: Install the bind packages on deb based systems
apt: pkg={{ item }} state={{ bind_pkg_state }} update_cache=yes cache_valid_time=1800
with_items: '{{ bind_pkg_list }}'
- name: Install the bind configuration
template: src=named.conf.options.j2 dest=/etc/bind/named.conf.options owner=root group=bind mode=0640
notify: reload bind
- name: Ensure that the bind service is running and enabled
service: name=bind9 state=started enabled=yes
@ -22,10 +18,9 @@
- name: Ensure that the bind service is stopped and disabled
service: name=bind9 state=stopped enabled=no
- name: Remove the bind packages
- name: Remove the bind packages on deb based systems
apt: pkg={{ item }} state=absent
with_items: '{{ bind_pkg_list }}'
when: not bind_install
tags: [ 'bind', 'caching_nameserver' ]

View File

@ -0,0 +1,8 @@
---
- import_tasks: deb-nameserver.yml
when: ansible_distribution_file_variety == "Debian"
- import_tasks: deb-caching-nameserver.yml
when:
- ansible_distribution_file_variety == "Debian"
- bind_caching_nameserver