forked from ISTI-ansible-roles/ansible-roles
Merge branch 'master' of adellam/ansible-roles into master
This commit is contained in:
commit
ea6af1eab8
|
@ -8,6 +8,31 @@ bind_pkg_list:
|
||||||
- '{{ bind_pkg_n }}-host'
|
- '{{ bind_pkg_n }}-host'
|
||||||
- '{{ bind_pkg_n }}utils'
|
- '{{ 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:
|
bind_allowed_query_acl:
|
||||||
- '{{ ansible_default_ipv4.address }}'
|
- '{{ ansible_default_ipv4.address }}'
|
||||||
|
|
||||||
|
@ -19,7 +44,6 @@ bind_forwarders_list:
|
||||||
bind_listen_on_ipv4: True
|
bind_listen_on_ipv4: True
|
||||||
bind_listen_on_ipv6:
|
bind_listen_on_ipv6:
|
||||||
- any
|
- any
|
||||||
bind_cache_dir: /var/cache/bind
|
|
||||||
bind_dnssec_enabled: False
|
bind_dnssec_enabled: False
|
||||||
bind_dnssec_validation: auto
|
bind_dnssec_validation: auto
|
||||||
# Default: 1 week
|
# Default: 1 week
|
|
@ -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' ]
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
---
|
---
|
||||||
- block:
|
- 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
|
apt: pkg={{ item }} state={{ bind_pkg_state }} update_cache=yes cache_valid_time=1800
|
||||||
with_items: '{{ bind_pkg_list }}'
|
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
|
- name: Ensure that the bind service is running and enabled
|
||||||
service: name=bind9 state=started enabled=yes
|
service: name=bind9 state=started enabled=yes
|
||||||
|
|
||||||
|
@ -22,10 +18,9 @@
|
||||||
- name: Ensure that the bind service is stopped and disabled
|
- name: Ensure that the bind service is stopped and disabled
|
||||||
service: name=bind9 state=stopped enabled=no
|
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
|
apt: pkg={{ item }} state=absent
|
||||||
with_items: '{{ bind_pkg_list }}'
|
with_items: '{{ bind_pkg_list }}'
|
||||||
|
|
||||||
when: not bind_install
|
when: not bind_install
|
||||||
tags: [ 'bind', 'caching_nameserver' ]
|
tags: [ 'bind', 'caching_nameserver' ]
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue