Skip to content
Snippets Groups Projects
Unverified Commit 503ab0f7 authored by Kenichi Omichi's avatar Kenichi Omichi Committed by GitHub
Browse files

Run 0100-dhclient-hooks if dhcpclient is enabled (#8658)

If running Kubespray on static IP environments, a task was failed like:

  TASK [kubernetes/preinstall : Configure dhclient hooks for resolv.conf (RH-only)]
  fatal: [ak8s2]: FAILED! => {
    "changed": false, "checksum": "..",
    "msg": "Destination directory /etc/dhcp/dhclient.d does not exist"}

This adds a check for dhclientconffile for running 0100-dhclient-hooks to
run the task only if dhcpclient is enabled.
parent 90883e76
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
mode: 0644 mode: 0644
notify: Preinstall | propagate resolvconf to k8s components notify: Preinstall | propagate resolvconf to k8s components
when: dhclientconffile is defined
- name: Configure dhclient hooks for resolv.conf (non-RH) - name: Configure dhclient hooks for resolv.conf (non-RH)
template: template:
......
...@@ -9,12 +9,10 @@ ...@@ -9,12 +9,10 @@
state: absent state: absent
backup: yes backup: yes
marker: "# Ansible entries {mark}" marker: "# Ansible entries {mark}"
when: dhclientconffile is defined
notify: Preinstall | propagate resolvconf to k8s components notify: Preinstall | propagate resolvconf to k8s components
- name: Remove kubespray specific dhclient hook - name: Remove kubespray specific dhclient hook
file: file:
path: "{{ dhclienthookfile }}" path: "{{ dhclienthookfile }}"
state: absent state: absent
when: dhclienthookfile is defined
notify: Preinstall | propagate resolvconf to k8s components notify: Preinstall | propagate resolvconf to k8s components
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
when: when:
- dns_mode != 'none' - dns_mode != 'none'
- resolvconf_mode == 'host_resolvconf' - resolvconf_mode == 'host_resolvconf'
- dhclientconffile is defined
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] - not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags: tags:
- bootstrap-os - bootstrap-os
...@@ -86,6 +87,7 @@ ...@@ -86,6 +87,7 @@
when: when:
- dns_mode != 'none' - dns_mode != 'none'
- resolvconf_mode != 'host_resolvconf' - resolvconf_mode != 'host_resolvconf'
- dhclientconffile is defined
- not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] - not ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
tags: tags:
- bootstrap-os - bootstrap-os
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment