main.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. - name: Check for legacy service
  3. stat:
  4. path: /lib/systemd/system/calico.service
  5. get_checksum: false
  6. get_attributes: false
  7. get_mime: false
  8. register: sym
  9. - fail:
  10. msg: You are running a systemd based installation of Calico. Please run the calico upgrade playbook to upgrade to a self-hosted installation.
  11. when: sym.stat.exists
  12. - name: Configure NetworkManager to ignore Calico interfaces
  13. copy:
  14. src: files/calico.conf
  15. dest: /etc/NetworkManager/conf.d/
  16. when: using_network_manager | default(true) | bool
  17. register: nm
  18. - name: restart NetworkManager
  19. systemd:
  20. name: NetworkManager
  21. state: restarted
  22. when: nm.changed
  23. # TODO: Move into shared vars file
  24. - name: Load default node image
  25. set_fact:
  26. calico_node_image: "quay.io/calico/node:v2.6.7"
  27. when: calico_node_image is not defined
  28. - name: Prepull Images
  29. command: "docker pull {{ calico_node_image }}"
  30. - name: Apply node label
  31. delegate_to: "{{ groups.oo_first_master.0 }}"
  32. command: >
  33. {{ openshift_client_binary }} --config={{ openshift.common.config_base }}/master/admin.kubeconfig label node {{ openshift.node.nodename | lower }} --overwrite projectcalico.org/ds-ready=true
  34. - name: Wait for node running
  35. uri:
  36. url: http://localhost:9099/readiness
  37. status_code: 204
  38. delay: 3
  39. retries: 10
  40. register: result
  41. until: result.status == 204