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.

41 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
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=0755
  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['etcd'][0] }}:2379"
  14. run_once: true
  15. delegate_to: "{{ groups['etcd'][0] }}"
  16. - name: Calico | Write calico-node systemd init file
  17. template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
  18. register: newservice
  19. notify:
  20. - reload systemd
  21. - restart calico-node
  22. - name: Calico | daemon-reload
  23. command: systemctl daemon-reload
  24. when: newservice|changed
  25. changed_when: False
  26. - name: Calico | Enable calico-node
  27. service: name=calico-node enabled=yes state=started
  28. - name: Calico | Disable node mesh
  29. shell: calicoctl bgp node-mesh off
  30. when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
  31. - name: Calico | Configure peering with router(s)
  32. shell: calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}
  33. with_items: peers
  34. when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']