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 0000000000000000000000000000000000000000..2e997647c8a3d3a69dc8d14e7521ae72a489e7ea --- /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 b63912d2b9fb0bfc0ec7bbcbebe3eb2b9e36a8aa..14b8275135ef2d470d7c59ad8d29fc111630da9b 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 b7b2f2ddf0e93bdd008902bbac8e92c7ec30a5d4..1aa2795aaa8eaeac06df710e4d1862a854776938 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 0000000000000000000000000000000000000000..b975fe5b12158bd2c414de03c5b13ff5e71b15ff --- /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 }}"