diff --git a/roles/kubernetes-apps/csi_driver/cinder/tasks/cinder-write-cacert.yml b/roles/kubernetes-apps/csi_driver/cinder/tasks/cinder-write-cacert.yml new file mode 100644 index 00000000000..2e997647c8a --- /dev/null +++ b/roles/kubernetes-apps/csi_driver/cinder/tasks/cinder-write-cacert.yml @@ -0,0 +1,12 @@ +--- +# include to workaround mitogen issue +# https://github.com/dw/mitogen/issues/663 + +- name: Cinder CSI Driver | Write cacert file + copy: + src: "{{ cinder_cacert }}" + dest: "{{ kube_config_dir }}/cinder-cacert.pem" + group: "{{ kube_cert_group }}" + mode: 0640 + tags: cinder-csi-driver + delegate_to: "{{ delegate_host_to_write_cacert }}" diff --git a/roles/kubernetes-apps/csi_driver/cinder/tasks/main.yml b/roles/kubernetes-apps/csi_driver/cinder/tasks/main.yml index b63912d2b9f..14b8275135e 100644 --- a/roles/kubernetes-apps/csi_driver/cinder/tasks/main.yml +++ b/roles/kubernetes-apps/csi_driver/cinder/tasks/main.yml @@ -3,11 +3,11 @@ tags: cinder-csi-driver - name: Cinder CSI Driver | Write cacert file - copy: - src: "{{ cinder_cacert }}" - dest: "{{ kube_config_dir }}/cinder-cacert.pem" - group: "{{ kube_cert_group }}" - mode: 0640 + include_tasks: cinder-write-cacert.yml + run_once: true + loop: "{{ groups['k8s-cluster'] }}" + loop_control: + loop_var: delegate_host_to_write_cacert when: - inventory_hostname in groups['k8s-cluster'] - cinder_cacert is defined diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/tasks/main.yml b/roles/kubernetes-apps/external_cloud_controller/openstack/tasks/main.yml index b7b2f2ddf0e..1aa2795aaa8 100644 --- a/roles/kubernetes-apps/external_cloud_controller/openstack/tasks/main.yml +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/tasks/main.yml @@ -3,11 +3,11 @@ tags: external-openstack - name: External OpenStack Cloud Controller | Write cacert file - copy: - src: "{{ external_openstack_cacert }}" - dest: "{{ kube_config_dir }}/external-openstack-cacert.pem" - group: "{{ kube_cert_group }}" - mode: 0640 + include_tasks: openstack-write-cacert.yml + run_once: true + loop: "{{ groups['k8s-cluster'] }}" + loop_control: + loop_var: delegate_host_to_write_cacert when: - inventory_hostname in groups['k8s-cluster'] - external_openstack_cacert is defined diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/tasks/openstack-write-cacert.yml b/roles/kubernetes-apps/external_cloud_controller/openstack/tasks/openstack-write-cacert.yml new file mode 100644 index 00000000000..b975fe5b121 --- /dev/null +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/tasks/openstack-write-cacert.yml @@ -0,0 +1,12 @@ +--- +# include to workaround mitogen issue +# https://github.com/dw/mitogen/issues/663 + +- name: External OpenStack Cloud Controller | Write cacert file + copy: + src: "{{ external_openstack_cacert }}" + dest: "{{ kube_config_dir }}/external-openstack-cacert.pem" + group: "{{ kube_cert_group }}" + mode: 0640 + tags: external-openstack + delegate_to: "{{ delegate_host_to_write_cacert }}"