From 9433fe46c806de7eeea6f9f67e786594bd765868 Mon Sep 17 00:00:00 2001 From: spaced Date: Tue, 7 Jul 2020 17:09:59 +0200 Subject: [PATCH] Add workaround with include_task for mitogen (#6312) --- .../local_volume_provisioner/tasks/basedirs.yml | 12 ++++++++++++ .../local_volume_provisioner/tasks/main.yml | 15 +++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/basedirs.yml diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/basedirs.yml b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/basedirs.yml new file mode 100644 index 000000000..7add2dac5 --- /dev/null +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/basedirs.yml @@ -0,0 +1,12 @@ +--- +# include to workaround mitogen issue +# https://github.com/dw/mitogen/issues/663 + +- name: "Local Volume Provisioner | Ensure base dir {{ delegate_host_base_dir.1 }} is created on {{ delegate_host_base_dir.0 }}" + file: + path: "{{ local_volume_provisioner_storage_classes[delegate_host_base_dir.1].host_dir }}" + state: directory + owner: root + group: root + mode: "{{ local_volume_provisioner_directory_mode }}" + delegate_to: "{{ delegate_host_base_dir.0 }}" diff --git a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml index 862084b7b..b4c4f68eb 100644 --- a/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml +++ b/roles/kubernetes-apps/external_provisioner/local_volume_provisioner/tasks/main.yml @@ -1,15 +1,10 @@ --- + - name: Local Volume Provisioner | Ensure base dir is created on all hosts - file: - path: "{{ local_volume_provisioner_storage_classes[item.1].host_dir }}" - state: directory - owner: root - group: root - mode: "{{ local_volume_provisioner_directory_mode }}" - delegate_to: "{{ item[0] }}" - with_nested: - - "{{ groups['k8s-cluster'] }}" - - "{{ local_volume_provisioner_storage_classes.keys() | list }}" + include_tasks: basedirs.yml + loop_control: + loop_var: delegate_host_base_dir + loop: "{{ groups['k8s-cluster'] | product(local_volume_provisioner_storage_classes.keys()) | list }}" - name: Local Volume Provisioner | Create addon dir file: