tripleo-heat-templates/deployment/nova/nova-compute-common-container-puppet.yaml
Martin Schuppert 3e7c15da24 Only run cellv2 host discovery on default cell
While it would be not an issue to run the host discovery on sub
sequent deploy runs, on the initial cell deplouy the discovery
fails because the cell is not yet defined in nova as this is
a manual post task after the initial cell deployment [1]

[1] https://docs.openstack.org/tripleo-docs/latest/install/advanced_deployment/deploy_cellv2.html#create-the-cell-and-discover-compute-nodes

Change-Id: I42451a8b4dcc690319439415570ce36e5c5333c3
Closes-bug: #1836915
2019-07-17 16:28:15 +02:00

84 lines
3.0 KiB
YAML

heat_template_version: rocky
description: >
Contains a static list of common things necessary for nova-compute containers
parameters:
# Required parameters
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
NovaAdditionalCell:
default: false
description: Whether this is an cell additional to the default cell.
type: boolean
outputs:
container_config_scripts:
description: Shared docker config scripts
value:
nova_statedir_ownership.py:
mode: "0700"
content: { get_file: ../../container_config_scripts/nova_statedir_ownership.py }
nova_wait_for_placement_service.py:
mode: "0755"
content: { get_file: ../../container_config_scripts/nova_wait_for_placement_service.py }
nova_wait_for_compute_service.py:
mode: "0755"
content: { get_file: ../../container_config_scripts/nova_wait_for_compute_service.py }
nova_compute_common_deploy_steps_tasks:
description: Common host prep tasks for nova-compute services (compute + ironic)
value: &nova_compute_common_deploy_steps_tasks
- when: step|int == 5
block:
- name: is additonal Cell?
set_fact:
nova_additional_cell: {get_param: NovaAdditionalCell}
- name: discover nodes if it is not an additional cell
when:
- not nova_additional_cell|bool
block:
- name: discover via nova_compute?
set_fact:
delegate_host: "{{ groups['nova_compute'][0] }}"
when:
- groups['nova_compute'] is defined and (groups['nova_compute']|length>0)
- name: discover via nova_ironic?
set_fact:
delegate_host: "{{ groups['nova_ironic'][0] }}"
when:
- delegate_host is not defined
- groups['nova_ironic'] is defined and (groups['nova_ironic']|length>0)
- name: Discovering nova hosts
command: "{{ container_cli }} exec nova_compute nova-manage cell_v2 discover_hosts --by-service"
become: true
changed_when: False
when:
- delegate_host is defined
- inventory_hostname == delegate_host