main.yml 921 B

123456789101112131415161718192021222324252627282930313233
  1. ---
  2. # TODO: move this to a new 'cli' role
  3. - openshift_facts:
  4. role: common
  5. local_facts:
  6. cli_image: "{{ osm_image | default(None) }}"
  7. - name: Install clients
  8. action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-clients state=present"
  9. when: not openshift.common.is_containerized | bool
  10. - name: Pull CLI Image
  11. command: >
  12. docker pull {{ openshift.common.cli_image }}:{{ openshift_version }}
  13. when: openshift.common.is_containerized | bool
  14. - name: Create /usr/local/bin/openshift cli wrapper
  15. template:
  16. src: openshift.j2
  17. dest: /usr/local/bin/openshift
  18. mode: 0755
  19. when: openshift.common.is_containerized | bool
  20. - name: Create client symlinks
  21. file:
  22. path: "{{ item }}"
  23. state: link
  24. src: /usr/local/bin/openshift
  25. with_items:
  26. - /usr/local/bin/oadm
  27. - /usr/local/bin/oc
  28. - /usr/local/bin/kubectl
  29. when: openshift.common.is_containerized | bool