- name: Create parent folder where distrio will be installed
  file:
    path: '{{ istio.dest }}'
    state: directory
    mode: 0755

- import_tasks: determine_version.yml

- name: Define var containing Istio dir
  set_fact:
    istio_dir: "{{ istio.dest }}/istio-{{ istio_version_to_use }}"

- name: Check if Istio distro folder exists under parent
  stat:
    path: "{{ istio_dir }}"
  register: p

- name: Show istio installation path
  debug: var=p.stat.path

- name: Install Istio distribution
  include_tasks: install.yml
  when: not p.stat.exists

- name: Set istio dir
  import_tasks: set_istio_distro_vars.yml

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