30 lines
		
	
	
		
			627 B
		
	
	
	
		
			YAML
		
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			627 B
		
	
	
	
		
			YAML
		
	
	
---
 | 
						|
- name: Install Bind9
 | 
						|
  apt:
 | 
						|
    update_cache: true
 | 
						|
    name: bind9
 | 
						|
  register: apt_result
 | 
						|
  retries: 3
 | 
						|
  until: apt_result is succeeded
 | 
						|
 | 
						|
- name: Deploy Bind9 configuration
 | 
						|
  template:
 | 
						|
    src: bind/{{ item }}.j2
 | 
						|
    dest: /etc/bind/{{ item }}
 | 
						|
    mode: 0640
 | 
						|
    owner: root
 | 
						|
    group: bind
 | 
						|
  loop:
 | 
						|
    - named.conf
 | 
						|
    - named.conf.local
 | 
						|
    - named.conf.key
 | 
						|
    - named.conf.options
 | 
						|
  when: item != "named.conf.key" or bind.rfc2136_keys is defined
 | 
						|
  notify: systemctl reload bind9.service
 | 
						|
 | 
						|
- name: Indicate role in motd
 | 
						|
  template:
 | 
						|
    src: update-motd.d/05-service.j2
 | 
						|
    dest: /etc/update-motd.d/05-bind
 | 
						|
    mode: 0755
 |