- name: Get istio k8s install path
  set_fact:
    istio_k8s_dir: "{{ playbook_dir | dirname }}"

- name: Set istio definition pull path
  import_tasks: set_istio_distro_vars.yml

- name: Add istio bin dir to PATH
  import_tasks: add_to_path.yml

- name: Deploy Istio from kubernetes file
  shell: "{{ cmd_path }} create -f {{ istio_definition_full_path }}"
  ignore_errors: true

- name: Create Routes in Openshift
  shell: "{{cmd_path}} expose svc {{item}} -n istio-system"
  with_items:
    - istio-ingressgateway
    - prometheus
    - grafana
  when: "cluster_flavour == 'ocp'"

- name: Deploy Addons defined such as Grafana, ...
  import_tasks: install_addons.yml
