c12s-kubespray/roles/kubernetes/preinstall/tasks/dhclient-hooks-undo.yml

28 lines
871 B
YAML
Raw Normal View History

---
# These tasks will undo changes done by kargo in the past if needed (e.g. when upgrading from kargo 2.0.x
# or when changing resolvconf_mode)
- name: Check if dhclient conf file exists
stat: path={{dhclientconffile}}
register: dhclientconf_check
- name: Remove kargo specific config from dhclient config
blockinfile:
dest: "{{dhclientconffile}}"
state: absent
backup: yes
follow: yes
marker: "# Ansible entries {mark}"
when: dhclientconf_check.stat.exists
notify: Preinstall | restart network
- name: Remove kargo specific dhclient hook
file: path="{{ dhclienthookfile }}" state=absent
when: dhclienthookfile is defined
notify: Preinstall | restart network
# We need to make sure the network is restarted early enough so that docker can later pick up the correct system
# nameservers and search domains
- meta: flush_handlers