main.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ---
  2. - set_fact:
  3. l_use_crio: "{{ openshift_use_crio | default(false) }}"
  4. - name: Install clients
  5. package: name={{ openshift.common.service_type }}-clients state=present
  6. when: not openshift.common.is_containerized | bool
  7. - block:
  8. - name: Pull CLI Image
  9. command: >
  10. docker pull {{ openshift.common.cli_image }}:{{ openshift_image_tag }}
  11. register: pull_result
  12. changed_when: "'Downloaded newer image' in pull_result.stdout"
  13. - name: Copy client binaries/symlinks out of CLI image for use on the host
  14. openshift_container_binary_sync:
  15. image: "{{ openshift.common.cli_image }}"
  16. tag: "{{ openshift_image_tag }}"
  17. backend: "docker"
  18. when:
  19. - openshift.common.is_containerized | bool
  20. - not l_use_crio
  21. - block:
  22. - name: Pull CLI Image
  23. command: >
  24. atomic pull --storage ostree {{ openshift.common.system_images_registry }}/{{ openshift.common.cli_image }}:{{ openshift_image_tag }}
  25. register: pull_result
  26. changed_when: "'Pulling layer' in pull_result.stdout"
  27. - name: Copy client binaries/symlinks out of CLI image for use on the host
  28. openshift_container_binary_sync:
  29. image: "{{ openshift.common.system_images_registry }}/{{ openshift.common.cli_image }}"
  30. tag: "{{ openshift_image_tag }}"
  31. backend: "atomic"
  32. when:
  33. - openshift.common.is_containerized | bool
  34. - l_use_crio
  35. - name: Reload facts to pick up installed OpenShift version
  36. openshift_facts:
  37. - name: Install bash completion for oc tools
  38. package: name=bash-completion state=present
  39. when: not openshift.common.is_containerized | bool