forked from ISTI-ansible-roles/ansible-roles
27 lines
865 B
YAML
27 lines
865 B
YAML
---
|
|
- block:
|
|
- 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: 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
|
|
|
|
- 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' ]
|