From c601c8faf2f9e4abeefeeeaff79b2bfd4cdf0b72 Mon Sep 17 00:00:00 2001 From: Kevin Huang Date: Thu, 12 Sep 2024 23:21:12 +0200 Subject: [PATCH] fix: Swap kubespray-defaults & boostrap-os (#11441) - Execute boostrap-os before so that Python is installed for kubespray-defaults - Remove outdated kubespray-defaults dependency on boostrap-os --- docs/operating_systems/bootstrap-os.md | 4 ---- playbooks/facts.yml | 2 +- roles/kubespray-defaults/tasks/main.yaml | 5 ----- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/docs/operating_systems/bootstrap-os.md b/docs/operating_systems/bootstrap-os.md index c2a75c06e48..5c779ff4b2f 100644 --- a/docs/operating_systems/bootstrap-os.md +++ b/docs/operating_systems/bootstrap-os.md @@ -40,10 +40,6 @@ Variables are listed with their default values, if applicable. * `centos_fastestmirror_enabled: false` Whether the [fastestmirror](https://wiki.centos.org/PackageManagement/Yum/FastestMirror) yum plugin should be enabled. -## Dependencies - -The `kubespray-defaults` role is expected to be run before this role. - ## Example Playbook Remember to disable fact gathering since Python might not be present on hosts. diff --git a/playbooks/facts.yml b/playbooks/facts.yml index d35eea80c28..89410cad49b 100644 --- a/playbooks/facts.yml +++ b/playbooks/facts.yml @@ -10,8 +10,8 @@ # fail. bootstrap-os fixes this on these systems, so in later plays it can be enabled. ansible_ssh_pipelining: false roles: - - { role: kubespray-defaults } - { role: bootstrap-os, tags: bootstrap-os} + - { role: kubespray-defaults } - name: Gather facts hosts: k8s_cluster:etcd:calico_rr diff --git a/roles/kubespray-defaults/tasks/main.yaml b/roles/kubespray-defaults/tasks/main.yaml index 0a9d987a7f0..282a4cd606e 100644 --- a/roles/kubespray-defaults/tasks/main.yaml +++ b/roles/kubespray-defaults/tasks/main.yaml @@ -1,10 +1,5 @@ --- - name: Set facts variables - # do not run gather facts when bootstrap-os in roles - when: > - ansible_play_role_names | - intersect(['bootstrap-os', 'kubernetes_sigs.kubespray.bootstrap-os']) | - length == 0 tags: - always block: