---
- name: gather facts used by role
  setup:
    gather_subset: "!min,distribution"
  when: ansible_distribution is not defined

- include: novajoin_prep.yml
  when: enable_tls_everywhere|bool and prepare_novajoin|bool
  tags:
    - undercloud-install

- include: create-scripts.yml
  tags:
    - undercloud-scripts

- include: install-undercloud.yml
  tags:
    - undercloud-install

# Ironic defaults to using `qemu:///system`.  When running libvirtd
# unprivileged we need to use `qemu:///session`.  This allows us to pass
# the value of libvirt_uri into /etc/ironic/ironic.conf.
- name: Configure Ironic pxe_ssh driver
  when: release in ['mitaka', 'liberty']
  delegate_to: undercloud
  ini_file:
    dest: /etc/ironic/ironic.conf
    section: ssh
    option: libvirt_uri
    value: '{{ libvirt_uri }}'
  become: true
  tags:
    - undercloud-install

- name: restart ironic conductor after changing configuration
  when: release in ['mitaka', 'liberty']
  become: true
  service:
    name: openstack-ironic-conductor
    enabled: true
    state: restarted
  tags:
    - undercloud-install

- include: post-install.yml
  tags:
    - undercloud-post-install

- include: tripleo-ui.yml
  tags:
    - undercloud-post-install
  when: (enable_vbmc|bool and undercloud_enable_ui|bool) or enable_libvirt_tripleo_ui|bool
