main.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. - name: Install clients
  3. action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}-clients state=present"
  4. when: not openshift.common.is_containerized | bool
  5. - name: Pull CLI Image
  6. command: >
  7. docker pull {{ openshift.common.cli_image }}:{{ openshift_image_tag }}
  8. when: openshift.common.is_containerized | bool
  9. - name: Create /usr/local/bin/openshift cli wrapper
  10. template:
  11. src: openshift.j2
  12. dest: /usr/local/bin/openshift
  13. mode: 0755
  14. when: openshift.common.is_containerized | bool
  15. - name: Create client symlinks
  16. file:
  17. path: "{{ item }}"
  18. state: link
  19. src: /usr/local/bin/openshift
  20. with_items:
  21. - /usr/local/bin/oadm
  22. - /usr/local/bin/oc
  23. - /usr/local/bin/kubectl
  24. when: openshift.common.is_containerized | bool
  25. - name: Reload facts to pick up installed OpenShift version
  26. openshift_facts:
  27. - name: Install bash completion for oc tools
  28. action: "{{ ansible_pkg_mgr }} name=bash-completion state=present"
  29. when: not openshift.common.is_containerized | bool