From db2412abc7baedd3500fbb643babd58aeca7deb2 Mon Sep 17 00:00:00 2001 From: Pat Riehecky Date: Tue, 30 May 2023 13:11:06 -0500 Subject: [PATCH] Don't create calico CNI dir when not using calico Signed-off-by: Pat Riehecky --- .../preinstall/tasks/0050-create_directories.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/roles/kubernetes/preinstall/tasks/0050-create_directories.yml b/roles/kubernetes/preinstall/tasks/0050-create_directories.yml index 996eb4f32c1..1e33ae2cdc8 100644 --- a/roles/kubernetes/preinstall/tasks/0050-create_directories.yml +++ b/roles/kubernetes/preinstall/tasks/0050-create_directories.yml @@ -89,6 +89,22 @@ - kube-router - bootstrap-os +- name: Create calico cni directories + file: + path: "{{ item }}" + state: directory + owner: "{{ kube_owner }}" + mode: 0755 + with_items: + - "/var/lib/calico" + when: + - kube_network_plugin == "calico" + - inventory_hostname in groups['k8s_cluster'] + tags: + - network + - calico + - bootstrap-os + - name: Create local volume provisioner directories file: path: "{{ local_volume_provisioner_storage_classes[item].host_dir }}"