main.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. - name: Install clients
  3. package: name={{ openshift_service_type }}-clients{{ openshift_pkg_version | default('') }} state=present
  4. when: not openshift_is_containerized | bool
  5. register: result
  6. until: result is succeeded
  7. - block:
  8. - name: Pull CLI Image
  9. command: >
  10. docker pull {{ openshift_cli_image }}:{{ openshift_image_tag }}
  11. register: pull_result
  12. changed_when: "'Downloaded newer image' in pull_result.stdout"
  13. # openshift_container_binary_sync is a custom module in lib_utils
  14. - name: Copy client binaries/symlinks out of CLI image for use on the host
  15. openshift_container_binary_sync:
  16. image: "{{ openshift_cli_image }}"
  17. tag: "{{ openshift_image_tag }}"
  18. backend: "docker"
  19. when:
  20. - openshift_is_containerized | bool
  21. - not l_use_cli_atomic_image | bool
  22. - block:
  23. - name: Pull CLI Image
  24. command: >
  25. atomic pull --storage ostree {{ 'docker:' if system_images_registry == 'docker' else system_images_registry + '/' }}{{ openshift_cli_image }}:{{ openshift_image_tag }}
  26. register: pull_result
  27. changed_when: "'Pulling layer' in pull_result.stdout"
  28. # openshift_container_binary_sync is a custom module in lib_utils
  29. - name: Copy client binaries/symlinks out of CLI image for use on the host
  30. openshift_container_binary_sync:
  31. image: "{{ '' if system_images_registry == 'docker' else system_images_registry + '/' }}{{ openshift_cli_image }}"
  32. tag: "{{ openshift_image_tag }}"
  33. backend: "atomic"
  34. when:
  35. - openshift_is_containerized | bool
  36. - l_use_cli_atomic_image | bool
  37. - name: Reload facts to pick up installed OpenShift version
  38. openshift_facts:
  39. - name: Install bash completion for oc tools
  40. package: name=bash-completion state=present
  41. when: not openshift_is_containerized | bool
  42. register: result
  43. until: result is succeeded