2016-11-30 13:06:11 +00:00
|
|
|
---
|
2016-12-13 14:43:05 +00:00
|
|
|
- name: Configure dhclient to supersede search/domain/nameservers
|
2016-11-30 13:06:11 +00:00
|
|
|
blockinfile:
|
|
|
|
block: |-
|
2016-12-13 14:43:05 +00:00
|
|
|
{% for item in [ supersede_domain, supersede_search, supersede_nameserver ] -%}
|
2016-11-30 13:06:11 +00:00
|
|
|
{{ item }}
|
|
|
|
{% endfor %}
|
|
|
|
dest: "{{dhclientconffile}}"
|
|
|
|
create: yes
|
|
|
|
state: present
|
|
|
|
insertbefore: BOF
|
|
|
|
backup: yes
|
|
|
|
follow: yes
|
|
|
|
marker: "# Ansible entries {mark}"
|
|
|
|
notify: Preinstall | restart network
|
2017-01-13 16:14:57 +00:00
|
|
|
when: dhclientconffile is defined
|
2016-11-30 13:06:11 +00:00
|
|
|
|
|
|
|
- name: Configue dhclient hooks for resolv.conf (non-RH)
|
|
|
|
template:
|
|
|
|
src: dhclient_dnsupdate.sh.j2
|
|
|
|
dest: "{{ dhclienthookfile }}"
|
|
|
|
owner: root
|
|
|
|
mode: 0755
|
|
|
|
notify: Preinstall | restart network
|
|
|
|
when: ansible_os_family != "RedHat"
|
|
|
|
|
|
|
|
- name: Configue dhclient hooks for resolv.conf (RH-only)
|
|
|
|
template:
|
|
|
|
src: dhclient_dnsupdate_rh.sh.j2
|
|
|
|
dest: "{{ dhclienthookfile }}"
|
|
|
|
owner: root
|
|
|
|
mode: 0755
|
|
|
|
notify: Preinstall | restart network
|
|
|
|
when: ansible_os_family == "RedHat"
|