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

  1. ---
  2. - name: Set cert dir
  3. set_fact:
  4. calico_cert_dir: "{{ canal_cert_dir }}"
  5. when: kube_network_plugin == 'canal'
  6. tags:
  7. - facts
  8. - canal
  9. - name: Delete the old calico-policy-controller if it exist
  10. kube:
  11. name: calico-policy-controller
  12. kubectl: "{{bin_dir}}/kubectl"
  13. resource: rs
  14. namespace: "{{ system_namespace }}"
  15. state: absent
  16. run_once: true
  17. - name: Create calico-kube-controllers manifests
  18. template:
  19. src: "{{item.file}}.j2"
  20. dest: "{{kube_config_dir}}/{{item.file}}"
  21. with_items:
  22. - {name: calico-kube-controllers, file: calico-kube-controllers.yml, type: deployment}
  23. - {name: calico-kube-controllers, file: calico-kube-sa.yml, type: sa}
  24. - {name: calico-kube-controllers, file: calico-kube-cr.yml, type: clusterrole}
  25. - {name: calico-kube-controllers, file: calico-kube-crb.yml, type: clusterrolebinding}
  26. register: calico_kube_manifests
  27. when:
  28. - rbac_enabled or item.type not in rbac_resources
  29. - name: Start of Calico kube controllers
  30. kube:
  31. name: "{{item.item.name}}"
  32. namespace: "{{ system_namespace }}"
  33. kubectl: "{{bin_dir}}/kubectl"
  34. resource: "{{item.item.type}}"
  35. filename: "{{kube_config_dir}}/{{item.item.file}}"
  36. state: "latest"
  37. with_items: "{{ calico_kube_manifests.results }}"
  38. when: inventory_hostname == groups['kube-master'][0] and not item|skipped