2016-12-30 12:47:12 +00:00
|
|
|
- set_fact:
|
|
|
|
calico_cert_dir: "{{ canal_cert_dir }}"
|
|
|
|
when: kube_network_plugin == 'canal'
|
2017-03-13 15:04:31 +00:00
|
|
|
tags: [facts, canal]
|
2016-12-30 12:47:12 +00:00
|
|
|
|
2017-07-04 12:03:55 +00:00
|
|
|
- name: Lay Down calico-policy-controller Template
|
|
|
|
template:
|
|
|
|
src: "{{item.file}}"
|
|
|
|
dest: "{{kube_config_dir}}/{{item.file}}"
|
|
|
|
with_items:
|
|
|
|
- {name: calico-policy-controller, file: calico-policy-controller-sa.yml, type: sa}
|
|
|
|
- {name: calico-policy-controller, file: calico-policy-controller-clusterrole.yml, type: clusterrole}
|
|
|
|
- {name: calico-policy-controller, file: calico-policy-controller-clusterrolebinding.yml, type: clusterrolebinding}
|
|
|
|
register: manifests
|
|
|
|
when: inventory_hostname == groups['kube-master'][0] and rbac_enabled
|
|
|
|
tags: canal
|
|
|
|
|
|
|
|
- name: Create calico-policy-controller Resources
|
|
|
|
kube:
|
|
|
|
name: "{{item.item.name}}"
|
|
|
|
namespace: "{{ system_namespace }}"
|
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
|
|
|
resource: "{{item.item.type}}"
|
|
|
|
filename: "{{kube_config_dir}}/{{item.item.file}}"
|
|
|
|
state: "{{item.changed | ternary('latest','present') }}"
|
|
|
|
with_items: "{{ manifests.results }}"
|
|
|
|
failed_when: manifests|failed and "Error from server (AlreadyExists)" not in manifests.msg
|
|
|
|
when: inventory_hostname == groups['kube-master'][0] and rbac_enabled
|
|
|
|
tags: canal
|
|
|
|
|
2016-10-10 14:09:50 +00:00
|
|
|
- name: Write calico-policy-controller yaml
|
2017-02-17 21:22:34 +00:00
|
|
|
template:
|
|
|
|
src: calico-policy-controller.yml.j2
|
|
|
|
dest: "{{kube_config_dir}}/calico-policy-controller.yml"
|
2016-10-10 14:09:50 +00:00
|
|
|
when: inventory_hostname == groups['kube-master'][0]
|
2017-03-13 15:04:31 +00:00
|
|
|
tags: canal
|
2016-10-10 14:09:50 +00:00
|
|
|
|
|
|
|
- name: Start of Calico policy controller
|
|
|
|
kube:
|
2016-11-08 11:20:55 +00:00
|
|
|
name: "calico-policy-controller"
|
2016-10-10 14:09:50 +00:00
|
|
|
kubectl: "{{bin_dir}}/kubectl"
|
2016-09-30 15:23:47 +00:00
|
|
|
filename: "{{kube_config_dir}}/calico-policy-controller.yml"
|
2016-12-13 10:43:06 +00:00
|
|
|
namespace: "{{system_namespace}}"
|
2016-11-08 11:20:55 +00:00
|
|
|
resource: "rs"
|
2016-10-10 14:09:50 +00:00
|
|
|
when: inventory_hostname == groups['kube-master'][0]
|
2017-03-13 15:04:31 +00:00
|
|
|
tags: canal
|