07bb11f556
Change I6fcbc5cb5d4f3cbb618d9661d2a36c868e18b3d6 implements a wait for the nova-placement API to be available. The backport did not adjust the configuration path for nova-placement to be compatible with a Stein deployment. This patch sets the correct configuration path for Stein only. Closes-Bug: 1853504 Related-Bug: 1842687 Change-Id: Ibfaaa5b114dd07155d78f9d2d84a4c4a14c22ac8
287 lines
11 KiB
YAML
287 lines
11 KiB
YAML
heat_template_version: rocky
|
|
|
|
description: >
|
|
OpenStack containerized Nova Placement API service. Note, this service is
|
|
deprecated in Stein and will be replaced in Train by an extracted Placement
|
|
API service.
|
|
|
|
parameters:
|
|
DockerNovaPlacementImage:
|
|
description: image
|
|
type: string
|
|
DockerNovaPlacementConfigImage:
|
|
description: The container image to use for the nova_placement config_volume
|
|
type: string
|
|
NovaPlacementLoggingSource:
|
|
type: json
|
|
default:
|
|
tag: openstack.nova.placement
|
|
path: /var/log/containers/httpd/nova_placement_wsgi_error_ssl.log
|
|
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
|
|
EnableInternalTLS:
|
|
type: boolean
|
|
default: false
|
|
NovaWorkers:
|
|
default: 0
|
|
description: Number of workers for Nova services.
|
|
type: number
|
|
NovaPassword:
|
|
description: The password for the nova service and db account
|
|
type: string
|
|
hidden: true
|
|
KeystoneRegion:
|
|
type: string
|
|
default: 'regionOne'
|
|
description: Keystone region for endpoint
|
|
MonitoringSubscriptionNovaPlacement:
|
|
default: 'overcloud-nova-placement'
|
|
type: string
|
|
|
|
conditions:
|
|
|
|
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
|
|
nova_workers_zero: {equals : [{get_param: NovaWorkers}, 0]}
|
|
|
|
resources:
|
|
|
|
ContainersCommon:
|
|
type: ../../containers-common.yaml
|
|
|
|
MySQLClient:
|
|
type: ../../../deployment/database/mysql-client.yaml
|
|
|
|
NovaPlacementLogging:
|
|
type: OS::TripleO::Services::Logging::NovaPlacement
|
|
|
|
ApacheServiceBase:
|
|
type: ../../../deployment/apache/apache-baremetal-puppet.yaml
|
|
properties:
|
|
ServiceData: {get_param: ServiceData}
|
|
ServiceNetMap: {get_param: ServiceNetMap}
|
|
DefaultPasswords: {get_param: DefaultPasswords}
|
|
EndpointMap: {get_param: EndpointMap}
|
|
RoleName: {get_param: RoleName}
|
|
RoleParameters: {get_param: RoleParameters}
|
|
EnableInternalTLS: {get_param: EnableInternalTLS}
|
|
|
|
NovaBase:
|
|
type: ../../nova/nova-base-puppet.yaml
|
|
properties:
|
|
ServiceData: {get_param: ServiceData}
|
|
ServiceNetMap: {get_param: ServiceNetMap}
|
|
DefaultPasswords: {get_param: DefaultPasswords}
|
|
EndpointMap: {get_param: EndpointMap}
|
|
RoleName: {get_param: RoleName}
|
|
RoleParameters: {get_param: RoleParameters}
|
|
|
|
outputs:
|
|
role_data:
|
|
description: Role data for the Nova Placement API role.
|
|
value:
|
|
service_name: nova_placement
|
|
monitoring_subscription: {get_param: MonitoringSubscriptionNovaPlacement}
|
|
config_settings:
|
|
map_merge:
|
|
- get_attr: [NovaBase, role_data, config_settings]
|
|
- get_attr: [NovaPlacementLogging, config_settings]
|
|
- apache::default_vhost: false
|
|
- get_attr: [ApacheServiceBase, role_data, config_settings]
|
|
- tripleo::nova_placement::firewall_rules:
|
|
'138 nova_placement':
|
|
dport:
|
|
- 8778
|
|
- 13778
|
|
nova::keystone::authtoken::project_name: 'service'
|
|
nova::keystone::authtoken::password: {get_param: NovaPassword}
|
|
nova::keystone::authtoken::www_authenticate_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
|
|
nova::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
|
|
nova::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
|
|
nova::wsgi::apache_placement::api_port: '8778'
|
|
nova::wsgi::apache_placement::ssl: {get_param: EnableInternalTLS}
|
|
# NOTE: bind IP is found in hiera replacing the network name with the local node IP
|
|
# for the given network; replacement examples (eg. for internal_api):
|
|
# internal_api -> IP
|
|
# internal_api_uri -> [IP]
|
|
# internal_api_subnet - > IP/CIDR
|
|
nova::wsgi::apache_placement::bind_host:
|
|
str_replace:
|
|
template:
|
|
"%{hiera('$NETWORK')}"
|
|
params:
|
|
$NETWORK: {get_param: [ServiceNetMap, NovaPlacementNetwork]}
|
|
nova::wsgi::apache_placement::servername:
|
|
str_replace:
|
|
template:
|
|
"%{hiera('fqdn_$NETWORK')}"
|
|
params:
|
|
$NETWORK: {get_param: [ServiceNetMap, NovaPlacementNetwork]}
|
|
-
|
|
if:
|
|
- nova_workers_zero
|
|
- {}
|
|
- nova::wsgi::apache_placement::workers: {get_param: NovaWorkers}
|
|
service_config_settings:
|
|
fluentd:
|
|
tripleo_fluentd_groups_nova_placement:
|
|
- nova
|
|
tripleo_fluentd_sources_nova_placement:
|
|
- {get_param: NovaPlacementLoggingSource}
|
|
keystone:
|
|
nova::keystone::auth_placement::tenant: 'service'
|
|
nova::keystone::auth_placement::public_url: {get_param: [EndpointMap, NovaPlacementPublic, uri]}
|
|
nova::keystone::auth_placement::internal_url: {get_param: [EndpointMap, NovaPlacementInternal, uri]}
|
|
nova::keystone::auth_placement::admin_url: {get_param: [EndpointMap, NovaPlacementAdmin, uri]}
|
|
nova::keystone::auth_placement::password: {get_param: NovaPassword}
|
|
nova::keystone::auth_placement::region: {get_param: KeystoneRegion}
|
|
mysql:
|
|
map_merge:
|
|
- {get_attr: [NovaBase, role_data, service_config_settings, mysql]}
|
|
- nova::db::mysql_placement::password: {get_param: NovaPassword}
|
|
nova::db::mysql_placement::user: nova_placement
|
|
nova::db::mysql_placement::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
|
|
nova::db::mysql_placement::dbname: nova_placement
|
|
nova::db::mysql_placement::allowed_hosts:
|
|
- '%'
|
|
- "%{hiera('mysql_bind_host')}"
|
|
# BEGIN DOCKER SETTINGS
|
|
puppet_config:
|
|
config_volume: nova_placement
|
|
puppet_tags: nova_config
|
|
step_config:
|
|
list_join:
|
|
- "\n"
|
|
- - include tripleo::profile::base::nova::placement
|
|
- {get_attr: [MySQLClient, role_data, step_config]}
|
|
config_image: {get_param: DockerNovaPlacementConfigImage}
|
|
kolla_config:
|
|
/var/lib/kolla/config_files/nova_placement.json:
|
|
command: /usr/sbin/httpd -DFOREGROUND
|
|
config_files:
|
|
- source: "/var/lib/kolla/config_files/src/etc/httpd/conf.d"
|
|
dest: "/etc/httpd/conf.d"
|
|
merge: false
|
|
preserve_properties: true
|
|
- source: "/var/lib/kolla/config_files/src/*"
|
|
dest: "/"
|
|
merge: true
|
|
preserve_properties: true
|
|
permissions:
|
|
- path: /var/log/nova
|
|
owner: nova:nova
|
|
recurse: true
|
|
container_config_scripts:
|
|
map_merge:
|
|
- {get_attr: [ContainersCommon, container_config_scripts]}
|
|
- placement_wait_for_service.py:
|
|
mode: "0755"
|
|
content: { get_file: ../../../container_config_scripts/placement_wait_for_service.py }
|
|
docker_config:
|
|
step_2:
|
|
get_attr: [NovaPlacementLogging, docker_config, step_2]
|
|
# start this early so it is up before computes start reporting
|
|
step_4:
|
|
nova_placement:
|
|
start_order: 1
|
|
image: &nova_placement_api_image {get_param: DockerNovaPlacementImage}
|
|
net: host
|
|
user: root
|
|
restart: always
|
|
healthcheck:
|
|
test: /openstack/healthcheck
|
|
volumes:
|
|
list_concat:
|
|
- {get_attr: [ContainersCommon, volumes]}
|
|
- get_attr: [NovaPlacementLogging, volumes]
|
|
-
|
|
- /var/lib/kolla/config_files/nova_placement.json:/var/lib/kolla/config_files/config.json:ro
|
|
- /var/lib/config-data/puppet-generated/nova_placement/:/var/lib/kolla/config_files/src:ro
|
|
-
|
|
if:
|
|
- internal_tls_enabled
|
|
- /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
|
|
- ''
|
|
-
|
|
if:
|
|
- internal_tls_enabled
|
|
- /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
|
|
- ''
|
|
environment:
|
|
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
|
|
nova_placement_wait_for_service:
|
|
start_order: 2
|
|
image: *nova_placement_api_image
|
|
user: root
|
|
net: host
|
|
privileged: false
|
|
detach: false
|
|
volumes:
|
|
list_concat:
|
|
- {get_attr: [ContainersCommon, volumes]}
|
|
- get_attr: [NovaPlacementLogging, volumes]
|
|
-
|
|
- /var/lib/container-config-scripts/:/container-config-scripts/:z
|
|
- /var/lib/config-data/nova_placement/etc/nova/:/etc/nova/:ro
|
|
command: "/usr/bin/bootstrap_host_exec nova_placement su nova -s /bin/bash -c '/container-config-scripts/pyshim.sh /container-config-scripts/placement_wait_for_service.py'"
|
|
environment:
|
|
- list_join:
|
|
- ''
|
|
- - '__OS_DEBUG='
|
|
- yaql:
|
|
expression: str($.data.debug)
|
|
data:
|
|
debug: {get_attr: [NovaBase, role_data, config_settings, 'nova::logging::debug']}
|
|
host_prep_tasks:
|
|
- {get_attr: [NovaPlacementLogging, host_prep_tasks]}
|
|
- name: create persistent directory
|
|
file:
|
|
path: /var/lib/nova
|
|
state: directory
|
|
setype: svirt_sandbox_file_t
|
|
post_upgrade_tasks:
|
|
- when: step|int == 1
|
|
import_role:
|
|
name: tripleo-docker-rm
|
|
vars:
|
|
containers_to_rm:
|
|
- nova_placement
|
|
external_upgrade_tasks:
|
|
- when:
|
|
- step|int == 1
|
|
tags:
|
|
- never
|
|
- system_upgrade_transfer_data
|
|
- system_upgrade_stop_services
|
|
block:
|
|
- name: Stop nova_placement container
|
|
import_role:
|
|
name: tripleo-container-stop
|
|
vars:
|
|
tripleo_containers_to_stop:
|
|
- nova_placement
|
|
tripleo_delegate_to: "{{ groups['nova_placement'] | default([]) }}"
|