Change the way 'debops.dhcpd' gathers nameservers

This commit is contained in:
Maciej Delmanowski 2015-08-29 20:01:23 +02:00
parent 4052e5e800
commit 271da470fb
2 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,9 @@ v0.1.1
- Fix a templating error when IPv6 networking is not present on a host.
[drybjed]
- Change the way role gathers the list of nameservers to avoid issue with
``sed`` command in shell module. [drybjed]
v0.1.0
------

View File

@ -28,14 +28,14 @@
when: dhcpd_register_relay_debconf|d() and dhcpd_register_relay_debconf.changed
- name: Get list of nameservers configured in /etc/resolv.conf
shell: grep -E '^nameserver\s' /etc/resolv.conf | awk '{print $2}' | sed -e 'N;s/\n/ /'
shell: grep -E '^nameserver\s' /etc/resolv.conf | awk '{print $2}'
register: dhcpd_register_nameservers
changed_when: False
when: dhcpd_mode == 'server'
- name: Convert list of nameservers to Ansible list
set_fact:
dhcpd_runtime_nameservers: "{{ dhcpd_register_nameservers.stdout.split(' ') }}"
dhcpd_runtime_nameservers: "{{ dhcpd_register_nameservers.stdout_lines }}"
when: (dhcpd_register_nameservers is defined and dhcpd_register_nameservers.stdout)
- name: Configure DHCP server