c12s-kubespray/roles/network_plugin/tasks/calico.yml

41 lines
1.3 KiB
YAML
Raw Normal View History

2015-10-03 20:19:50 +00:00
---
- name: Calico | Install calicoctl bin
2015-11-20 13:04:13 +00:00
copy:
2015-10-03 20:19:50 +00:00
src={{ local_release_dir }}/calico/bin/calicoctl
dest={{ bin_dir }}
mode=u+x
notify: restart calico-node
- name: Calico | Create calicoctl symlink (needed by kubelet)
2015-10-03 20:19:50 +00:00
file: src=/usr/local/bin/calicoctl dest=/usr/bin/calicoctl state=link
- name: Calico | Configure calico-node desired pool
shell: calicoctl pool add {{ kube_pods_subnet }}
environment:
ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:2379"
run_once: true
- name: Calico | Write calico-node systemd init file
2015-10-03 20:19:50 +00:00
template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
2015-11-20 13:04:13 +00:00
register: newservice
notify:
2015-10-03 20:19:50 +00:00
- reload systemd
- restart calico-node
2015-11-20 13:04:13 +00:00
- name: Calico | daemon-reload
command: systemctl daemon-reload
when: newservice|changed
changed_when: False
- name: Calico | Enable calico-node
2015-10-03 20:19:50 +00:00
service: name=calico-node enabled=yes state=started
- name: Calico | Disable node mesh
shell: calicoctl bgp node-mesh off
2015-11-02 12:41:03 +00:00
when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
- name: Calico | Configure peering with router(s)
shell: calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}
with_items: peers
2015-11-02 12:41:03 +00:00
when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']