aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/nova-cell/tasks/discover_computes.yml
blob: b49285b7e630f0f32829d879395d47d47d34688d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
# Discover compute hosts for a cell.

- # Delegate to a cell conductor.
  delegate_to: "{{ groups[nova_cell_conductor_group][0] }}"
  # Fail all hosts if any of these once-per-cell tasks fail.
  any_errors_fatal: true
  block:
    - import_tasks: get_cell_settings.yml

    - name: Fail if cell settings not found
      fail:
        msg: >-
          Unable to find settings for {{ nova_cell_name or 'the default cell' }}.
      when: not nova_cell_settings

    # TODO(yoctozepto): no need to do --by-service if ironic not used
    - name: Discover nova hosts
      become: true
      command: >
        {{ kolla_container_engine }} exec -t nova_conductor nova-manage cell_v2 discover_hosts --by-service --cell_uuid {{ nova_cell_settings.cell_uuid }}
      changed_when: False