|
@@ -41,6 +41,22 @@
|
|
|
#- name: Extract the serial if rzone was updated
|
|
|
#- name: Bump up the serial if rzone was updated
|
|
|
|
|
|
-# TODO: delegate zone on bastion
|
|
|
-# TODO: make sure DHCP server recognizes us
|
|
|
+- name: Delegate the new zone to utility from bastion
|
|
|
+ delegate_to: bastion.lab.example.com
|
|
|
+ template:
|
|
|
+ src: templates/dnsmasq.conf.j2
|
|
|
+ dest: /etc/dnsmasq.d/{{ node.cluster }}.conf
|
|
|
+ mode: 0644
|
|
|
+ owner: root
|
|
|
+ group: root
|
|
|
+ notify: restart_bastion_dnsmasq
|
|
|
+
|
|
|
+- name: Make sure DHCP server recognizes us
|
|
|
+ lineinfile:
|
|
|
+ path: /etc/dhcp/dhcpd.conf
|
|
|
+ insertafter: "^# BEGIN ANSIBLE MANAGED DHCP CONFIG$"
|
|
|
+ regexp: "hardware ethernet {{ node.mac | regex_replace('^01-', '') | regex_replace_all('-', ':') }}"
|
|
|
+ line: 'host {{ node.name }}-{{ node.cluster }} { hardware ethernet {{ node.mac | regex_replace("^01-", "") | regex_replace_all("-", ":") }}; fixed-address {{ node.ip }}; option host-name "{{ node.name }}.{{ node.cluster }}.example.com."; }'
|
|
|
+ state: present
|
|
|
+ notify: restart_dhcpd
|
|
|
...
|