2016-11-30 21:06:11 +08:00
|
|
|
---
|
2016-12-13 22:43:05 +08:00
|
|
|
- name: Configure dhclient to supersede search/domain/nameservers
|
2016-11-30 21:06:11 +08:00
|
|
|
blockinfile:
|
|
|
|
block: |-
|
2023-07-05 11:36:54 +08:00
|
|
|
{% for item in [supersede_domain, supersede_search, supersede_nameserver] -%}
|
2016-11-30 21:06:11 +08:00
|
|
|
{{ item }}
|
|
|
|
{% endfor %}
|
2019-05-03 05:24:21 +08:00
|
|
|
path: "{{ dhclientconffile }}"
|
2016-11-30 21:06:11 +08:00
|
|
|
create: yes
|
|
|
|
state: present
|
|
|
|
insertbefore: BOF
|
|
|
|
backup: yes
|
|
|
|
marker: "# Ansible entries {mark}"
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2019-11-07 02:11:52 +08:00
|
|
|
notify: Preinstall | propagate resolvconf to k8s components
|
2016-11-30 21:06:11 +08:00
|
|
|
|
2018-04-06 06:54:58 +08:00
|
|
|
- name: Configure dhclient hooks for resolv.conf (non-RH)
|
2016-11-30 21:06:11 +08:00
|
|
|
template:
|
|
|
|
src: dhclient_dnsupdate.sh.j2
|
|
|
|
dest: "{{ dhclienthookfile }}"
|
|
|
|
owner: root
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0755"
|
2019-11-07 02:11:52 +08:00
|
|
|
notify: Preinstall | propagate resolvconf to k8s components
|
2021-12-10 06:09:06 +08:00
|
|
|
when: ansible_os_family not in [ "RedHat", "Suse" ]
|
2016-11-30 21:06:11 +08:00
|
|
|
|
2018-04-06 06:54:58 +08:00
|
|
|
- name: Configure dhclient hooks for resolv.conf (RH-only)
|
2016-11-30 21:06:11 +08:00
|
|
|
template:
|
|
|
|
src: dhclient_dnsupdate_rh.sh.j2
|
|
|
|
dest: "{{ dhclienthookfile }}"
|
|
|
|
owner: root
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0755"
|
2019-11-07 02:11:52 +08:00
|
|
|
notify: Preinstall | propagate resolvconf to k8s components
|
2016-11-30 21:06:11 +08:00
|
|
|
when: ansible_os_family == "RedHat"
|