k8s-sig-cluster-lifecycleawskubesprayhigh-availabilityansiblekubernetes-clustergcekubernetesbare-metal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
---
|
|
- name: Configure dhclient to supersede search/domain/nameservers
|
|
blockinfile:
|
|
# 1 is the 2nd item of a tuple in items()
|
|
block: |-
|
|
{% for key, val in dhclient_supersede.items() | rejectattr(1, '==', []) -%}
|
|
{% if key == "domain-name-servers" -%}
|
|
supersede {{ key }} {{ val | join(',') }};
|
|
{% else -%}
|
|
supersede {{ key }} "{{ val | join('","') }}";
|
|
{% endif -%}
|
|
{% endfor %}
|
|
path: "{{ dhclientconffile }}"
|
|
create: true
|
|
state: present
|
|
insertbefore: BOF
|
|
backup: "{{ leave_etc_backup_files }}"
|
|
marker: "# Ansible entries {mark}"
|
|
mode: "0644"
|
|
notify: Preinstall | propagate resolvconf to k8s components
|
|
|
|
- name: Configure dhclient hooks for resolv.conf (non-RH)
|
|
template:
|
|
src: dhclient_dnsupdate.sh.j2
|
|
dest: "{{ dhclienthookfile }}"
|
|
owner: root
|
|
mode: "0755"
|
|
notify: Preinstall | propagate resolvconf to k8s components
|
|
when: ansible_os_family not in [ "RedHat", "Suse" ]
|
|
|
|
- name: Configure dhclient hooks for resolv.conf (RH-only)
|
|
template:
|
|
src: dhclient_dnsupdate_rh.sh.j2
|
|
dest: "{{ dhclienthookfile }}"
|
|
owner: root
|
|
mode: "0755"
|
|
notify: Preinstall | propagate resolvconf to k8s components
|
|
when: ansible_os_family == "RedHat"
|