---
- debug:
    msg: >
      Static inventory is DEPRACATED and not supported any more!
      Use https://github.com/openshift/openshift-ansible/blob/master/playbooks/openstack/sample-inventory/inventory.py
      instead.

- name: Remove any existing inventory
  file:
    path: "{{ inventory_path }}/hosts"
    state: absent

- name: Refresh the inventory
  meta: refresh_inventory

- name: Generate in-memory inventory
  include: openstack.yml

- name: Checkpoint in-memory data into a static inventory
  include: checkpoint.yml

- name: Generate SSH config for accessing hosts via bastion
  include: sshconfig.yml
  when: use_bastion|bool

- name: Configure SSH tunneling to access UI
  include: sshtun.yml
  become: true
  when:
    - use_bastion|bool
    - ui_ssh_tunnel|bool
