Merge pull request #893 from kubernetes-incubator/undo_hostresolvconf
Don't try to delete kargo specific config from dhclient when file does not exist
This commit is contained in:
commit
2a2953c674
1 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,10 @@
|
||||||
# These tasks will undo changes done by kargo in the past if needed (e.g. when upgrading from kargo 2.0.x
|
# 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)
|
# 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
|
- name: Remove kargo specific config from dhclient config
|
||||||
blockinfile:
|
blockinfile:
|
||||||
dest: "{{dhclientconffile}}"
|
dest: "{{dhclientconffile}}"
|
||||||
|
@ -10,12 +14,13 @@
|
||||||
backup: yes
|
backup: yes
|
||||||
follow: yes
|
follow: yes
|
||||||
marker: "# Ansible entries {mark}"
|
marker: "# Ansible entries {mark}"
|
||||||
|
when: dhclientconf_check.stat.exists
|
||||||
notify: Preinstall | restart network
|
notify: Preinstall | restart network
|
||||||
|
|
||||||
- name: Remove kargo specific dhclient hook
|
- name: Remove kargo specific dhclient hook
|
||||||
file: path="{{ dhclienthookfile }}" state=absent
|
file: path="{{ dhclienthookfile }}" state=absent
|
||||||
|
when: dhclienthookfile is defined
|
||||||
notify: Preinstall | restart network
|
notify: Preinstall | restart network
|
||||||
when: ansible_os_family != "RedHat"
|
|
||||||
|
|
||||||
# We need to make sure the network is restarted early enough so that docker can later pick up the correct system
|
# 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
|
# nameservers and search domains
|
||||||
|
|
Loading…
Reference in a new issue