heat_template_version: wallaby description: > Configuration of Nova Availability Zones in the overcloud parameters: 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. Use parameter_merge_strategies to merge it with the defaults. 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 EndpointMap: default: {} description: Mapping of service endpoint -> protocol. Typically set via parameter_defaults in the resource registry. type: json AdminPassword: description: The password for the keystone admin account, used for monitoring, querying neutron etc. type: string hidden: true NovaComputeAvailabilityZone: description: The availability zone where new Nova compute nodes will be added. If the zone does not already exist, it will be created. If left unset, it will default to the value of the stack name. default: "" type: string RootStackName: description: The name of the stack/plan. type: string AuthCloudName: description: Entry in clouds.yaml to use for authentication type: string default: "" conditions: availability_zone_set: not: {equals: [{get_param: NovaComputeAvailabilityZone}, ""]} auth_cloud_name_set: not: {equals: [{get_param: AuthCloudName}, ""]} outputs: role_data: description: Role data for the Nova Availability Zone configuration service value: service_name: nova_az_config deploy_steps_tasks: # Step0: Get the [DEFAULT] host parameter from nova.conf and set it as # an ansible fact so that we can use it later in the tasks in # external_post_deploy_tasks - name: Get the host parameter from nova.conf when: step|int == 2 block: - name: Read the parameter from nova.conf shell: crudini --get /var/lib/config-data/puppet-generated/nova_libvirt/etc/nova/nova.conf DEFAULT host register: nova_host_output - name: Set nova_host fact set_fact: nova_host: "{{ nova_host_output.stdout }}" external_post_deploy_tasks: - name: "Nova: Manage aggregate and availability zone and add hosts to the zone" become: true environment: OS_CLOUD: if: - auth_cloud_name_set - {get_param: AuthCloudName} - {get_param: RootStackName} os_nova_host_aggregate: name: &availability_zone if: - availability_zone_set - {get_param: NovaComputeAvailabilityZone} - {get_param: RootStackName} availability_zone: *availability_zone hosts: "{{ groups['nova_compute'] | default([]) | map('extract', hostvars, 'nova_host') | select('defined') | list }}"