You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.3 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. ---
  2. - name: Calico | Install calicoctl bin
  3. copy:
  4. src={{ local_release_dir }}/calico/bin/calicoctl
  5. dest={{ bin_dir }}
  6. mode=u+x
  7. notify: restart calico-node
  8. - name: Calico | Create calicoctl symlink (needed by kubelet)
  9. file: src=/usr/local/bin/calicoctl dest=/usr/bin/calicoctl state=link
  10. - name: Calico | Configure calico-node desired pool
  11. shell: calicoctl pool add {{ kube_pods_subnet }}
  12. environment:
  13. ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:2379"
  14. run_once: true
  15. - name: Calico | Write calico-node systemd init file
  16. template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
  17. register: newservice
  18. notify:
  19. - reload systemd
  20. - restart calico-node
  21. - name: Calico | daemon-reload
  22. command: systemctl daemon-reload
  23. when: newservice|changed
  24. changed_when: False
  25. - name: Calico | Enable calico-node
  26. service: name=calico-node enabled=yes state=started
  27. - name: Calico | Disable node mesh
  28. shell: calicoctl bgp node-mesh off
  29. when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
  30. - name: Calico | Configure peering with router(s)
  31. shell: calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}
  32. with_items: peers
  33. when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']