---
# Non local deployments by quickstart
- name: Install delorian repos
  hosts: overcloud
  any_errors_fatal: true
  gather_facts: false
  become: true
  vars_files:
    - ../vars/overcloud-traas.yaml
  roles:
    - {role: repo-setup,  when: configure_repos|bool

- name: Run overcloud prep roles
  hosts: undercloud
  any_errors_fatal: true
  vars_files:
    - ../vars/overcloud-traas.yaml
  gather_facts: false
  become: true
  roles:
    - overcloud-prep-config
    - overcloud-prep-containers

- name:  Deploy the overcloud (multinode)
  any_errors_fatal: true
  hosts: undercloud
  gather_facts: true
  become: false
  vars_files:
    - ../vars/overcloud-traas.yaml
  roles:
    - overcloud-deploy
  #TODO parametrize env vars for the deployed-server remaining roles
  environment:
    OVERCLOUD_ROLES: "{{overcloud_deployed_roles}}"
    ControllerDeployedServer_hosts: "{{controller_hosts}}"
    SUBNODES_SSH_KEY: "{{subnodes_ssh_key}}"
  #  ComputeDeployedServer_hosts: "{{compute_hosts}}"

- name: Add the overcloud nodes to the generated inventory
  any_errors_fatal: true
  hosts: undercloud
  gather_facts: false
  vars_files:
    - ../vars/overcloud-traas.yaml
  become: false
  tags:
    - overcloud-deploy
  vars:
      inventory: all
  roles:
    - tripleo-inventory

---
# Non local deployments by quickstart
- name: Install delorian repos
  hosts: overcloud
  any_errors_fatal: true
  gather_facts: false
  become: true
  vars_files:
    - ../vars/overcloud-traas.yaml
  roles:
    - {role: repo-setup,  when: configure_repos|bool}

- name: Run overcloud prep roles
  hosts: undercloud
  any_errors_fatal: true
  vars_files:
    - ../vars/overcloud-traas.yaml
  gather_facts: false
  become: true
  roles:
    - overcloud-prep-config
    - overcloud-prep-containers

- name:  Deploy the overcloud (multinode)
  any_errors_fatal: true
  hosts: undercloud
  gather_facts: true
  become: false
  vars_files:
    - ../vars/overcloud-traas.yaml
  roles:
    - overcloud-deploy
  #TODO parametrize env vars for the deployed-server remaining roles
  environment:
    OVERCLOUD_ROLES: "{{overcloud_deployed_roles}}"
    ControllerDeployedServer_hosts: "{{controller_hosts}}"
    SUBNODES_SSH_KEY: "{{subnodes_ssh_key}}"
  #  ComputeDeployedServer_hosts: "{{compute_hosts}}"

Drop inventory update for OC deploy
Drop inventory update for OC deploy

Pre-provisioned servers are populated from the step 1

Signed-off-by: Bogdan Dobrelya <62b3a3e71fe69d786a0eb2bf561b6ce08e31d2cc@mail.ru>
