2016-11-08 19:13:20 +08:00
|
|
|
- name: Create canal ConfigMap
|
|
|
|
run_once: true
|
|
|
|
kube:
|
|
|
|
name: "canal-config"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
2016-12-13 18:43:06 +08:00
|
|
|
filename: "{{kube_config_dir}}/canal-config.yaml"
|
2016-11-08 19:13:20 +08:00
|
|
|
resource: "configmap"
|
2016-12-13 18:43:06 +08:00
|
|
|
namespace: "{{system_namespace}}"
|
2016-11-08 19:13:20 +08:00
|
|
|
|
2017-02-08 22:13:17 +08:00
|
|
|
#FIXME: remove if kubernetes/features#124 is implemented
|
|
|
|
- name: Purge old flannel and canal-node
|
|
|
|
run_once: true
|
|
|
|
kube:
|
|
|
|
name: "canal-node"
|
|
|
|
kubectl: "{{ bin_dir }}/kubectl"
|
2017-02-10 18:27:41 +08:00
|
|
|
filename: "{{ kube_config_dir }}/canal-node.yaml"
|
2017-02-08 22:13:17 +08:00
|
|
|
resource: "ds"
|
|
|
|
namespace: "{{system_namespace}}"
|
|
|
|
state: absent
|
|
|
|
when: inventory_hostname == groups['kube-master'][0] and canal_node_manifest.changed
|
|
|
|
|
2016-11-03 23:57:11 +08:00
|
|
|
- name: Start flannel and calico-node
|
|
|
|
run_once: true
|
|
|
|
kube:
|
|
|
|
name: "canal-node"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
2016-12-13 18:43:06 +08:00
|
|
|
filename: "{{kube_config_dir}}/canal-node.yaml"
|
2016-11-03 23:57:11 +08:00
|
|
|
resource: "ds"
|
2016-12-13 18:43:06 +08:00
|
|
|
namespace: "{{system_namespace}}"
|
2017-02-08 22:13:17 +08:00
|
|
|
state: "{{ item | ternary('latest','present') }}"
|
|
|
|
with_items: "{{ canal_node_manifest.changed }}"
|
|
|
|
|