diff --git a/roles/network_plugin/canal/tasks/main.yml b/roles/network_plugin/canal/tasks/main.yml index ea67e20cd..64e3c9197 100644 --- a/roles/network_plugin/canal/tasks/main.yml +++ b/roles/network_plugin/canal/tasks/main.yml @@ -29,8 +29,7 @@ {{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} \ set /{{ cluster_name }}/network/config \ '{ "Network": "{{ kube_pods_subnet }}", "SubnetLen": {{ kube_network_node_prefix }}, "Backend": { "Type": "{{ flannel_backend_type }}" } }' - delegate_to: "{{groups['etcd'][0]}}" - run_once: true + when: inventory_hostname == groups['etcd'][0] - name: Canal | Write canal configmap template: diff --git a/roles/network_plugin/flannel/tasks/main.yml b/roles/network_plugin/flannel/tasks/main.yml index 573b51f19..08d8a64e6 100644 --- a/roles/network_plugin/flannel/tasks/main.yml +++ b/roles/network_plugin/flannel/tasks/main.yml @@ -4,8 +4,7 @@ {{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} \ set /{{ cluster_name }}/network/config \ '{ "Network": "{{ kube_pods_subnet }}", "SubnetLen": {{ kube_network_node_prefix }}, "Backend": { "Type": "{{ flannel_backend_type }}" } }' - delegate_to: "{{groups['etcd'][0]}}" - run_once: true + when: inventory_hostname == groups['etcd'][0] - name: Flannel | Create flannel certs directory file: