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.

46 lines
1.5 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
  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 | Write calico-node systemd init file
  11. template: src=calico/calico-node.service.j2 dest=/etc/systemd/system/calico-node.service
  12. notify:
  13. - reload systemd
  14. - restart calico-node
  15. - name: Calico | Write network-environment
  16. template: src=calico/network-environment.j2 dest=/etc/network-environment mode=u+x
  17. notify:
  18. - reload systemd
  19. - restart calico-node
  20. - name: Calico | Enable calico-node
  21. service: name=calico-node enabled=yes state=started
  22. - name: Calico | Configure calico-node remove default pool
  23. shell: calicoctl pool remove 192.168.0.0/16
  24. environment:
  25. ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:4001"
  26. run_once: true
  27. - name: Calico | Configure calico-node desired pool
  28. shell: calicoctl pool add {{ kube_pods_subnet }}
  29. environment:
  30. ETCD_AUTHORITY: "{{ groups['kube-master'][0] }}:4001"
  31. run_once: true
  32. - name: Calico | Disable node mesh
  33. shell: calicoctl bgp node-mesh off
  34. when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']
  35. - name: Calico | Configure peering with router(s)
  36. shell: calicoctl node bgp peer add {{ item.router_id }} as {{ item.as }}
  37. with_items: peers
  38. when: peer_with_router|default(false) and inventory_hostname in groups['kube-node']