2016-08-04 16:59:11 +02:00
|
|
|
---
|
|
|
|
- block:
|
2019-08-05 18:14:21 +02:00
|
|
|
- name: Install the bind packages on deb based systems
|
2016-08-04 16:59:11 +02:00
|
|
|
apt: pkg={{ item }} state={{ bind_pkg_state }} update_cache=yes cache_valid_time=1800
|
|
|
|
with_items: '{{ bind_pkg_list }}'
|
|
|
|
|
|
|
|
- name: Ensure that the bind service is running and enabled
|
|
|
|
service: name=bind9 state=started enabled=yes
|
|
|
|
|
|
|
|
- name: Ensure that the bind service is stopped and disabled
|
|
|
|
service: name=bind9 state=stopped enabled=no
|
|
|
|
when: not bind_enabled
|
|
|
|
|
|
|
|
when: bind_enabled
|
|
|
|
tags: [ 'bind', 'caching_nameserver' ]
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: Ensure that the bind service is stopped and disabled
|
|
|
|
service: name=bind9 state=stopped enabled=no
|
|
|
|
|
2019-08-05 18:14:21 +02:00
|
|
|
- name: Remove the bind packages on deb based systems
|
2016-08-04 16:59:11 +02:00
|
|
|
apt: pkg={{ item }} state=absent
|
|
|
|
with_items: '{{ bind_pkg_list }}'
|
|
|
|
|
|
|
|
when: not bind_install
|
|
|
|
tags: [ 'bind', 'caching_nameserver' ]
|