install.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. - name: Install openshift support packages
  3. package:
  4. name: "{{ openshift_node_support_packages | join(',') }}"
  5. update_cache: true
  6. async: 3600
  7. poll: 30
  8. # FIXME: Creation of these directories should not be required for crio 1.14.5
  9. - name: Create CNI dirs for crio
  10. file:
  11. path: "{{ item }}"
  12. state: directory
  13. owner: root
  14. group: root
  15. mode: 0755
  16. loop:
  17. - /var/lib/cni/bin
  18. - /etc/kubernetes/cni/net.d/
  19. - /opt/cni/bin/
  20. - name: Get cluster version
  21. command: >
  22. oc get clusterversion
  23. --config={{ openshift_node_kubeconfig_path }}
  24. --output=jsonpath='{.items[0].status.desired.version}'
  25. delegate_to: localhost
  26. register: oc_get
  27. until:
  28. - oc_get.stdout is defined
  29. - oc_get.stdout != ''
  30. retries: 36
  31. delay: 5
  32. - name: Set fact l_cluster_version
  33. set_fact:
  34. l_cluster_version: "-{{ oc_get.stdout | regex_search('^\\d+\\.\\d+\\.\\d+') }}"
  35. - name: Override version when running CI
  36. set_fact:
  37. l_cluster_version: ""
  38. when: ci_version_override | default(False) | bool == True
  39. - block:
  40. - name: Install openshift packages
  41. package:
  42. name: "{{ openshift_node_packages | join(',') }}"
  43. state: present
  44. async: 3600
  45. poll: 30
  46. rescue:
  47. - name: Package install failure message
  48. fail:
  49. msg: >
  50. Unable to install {{ openshift_node_packages | join(', ') }}.
  51. Please ensure repos are configured properly to provide these packages
  52. and indicated versions.
  53. - name: Enable the CRI-O service
  54. systemd:
  55. name: "crio"
  56. enabled: yes