main.yml 882 B

12345678910111213141516171819202122232425262728293031
  1. ---
  2. - debug: var=openshift_version
  3. - debug: var=openshift.common
  4. - name: Install clients
  5. action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-clients state=present"
  6. when: not openshift.common.is_containerized | bool
  7. # TODO: handle no openshift_version set?
  8. - name: Pull CLI Image
  9. command: >
  10. docker pull {{ openshift.common.cli_image }}:v{{ openshift_version }}
  11. when: openshift.common.is_containerized | bool
  12. - name: Create /usr/local/bin/openshift cli wrapper
  13. template:
  14. src: openshift.j2
  15. dest: /usr/local/bin/openshift
  16. mode: 0755
  17. when: openshift.common.is_containerized | bool
  18. - name: Create client symlinks
  19. file:
  20. path: "{{ item }}"
  21. state: link
  22. src: /usr/local/bin/openshift
  23. with_items:
  24. - /usr/local/bin/oadm
  25. - /usr/local/bin/oc
  26. - /usr/local/bin/kubectl
  27. when: openshift.common.is_containerized | bool