Merge "placement: Add nova_api data extraction step during deployment"

This commit is contained in:
Zuul 2019-05-15 12:12:51 +00:00 committed by Gerrit Code Review
commit c609599fe5
1 changed files with 57 additions and 1 deletions

View File

@ -64,6 +64,10 @@ parameters:
default:
tag: openstack.placement
path: /var/log/containers/httpd/placement_wsgi_error_ssl.log
NovaPassword:
description: The password for the nova service and db account
type: string
hidden: true
conditions:
placement_workers_zero: {equals : [{get_param: PlacementWorkers}, 0]}
@ -197,9 +201,53 @@ outputs:
step_2:
get_attr: [PlacementLogging, docker_config, step_2]
step_3:
placement_api_db_extract_data_from_nova_api:
start_order: 0
image: &placement_api_image {get_param: DockerPlacementImage}
net: host
detach: false
user: root
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
- {get_attr: [PlacementLogging, volumes]}
-
- /var/lib/config-data/placement/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
- /var/lib/config-data/placement/etc/placement/:/etc/placement/:ro
- /var/lib/config-data/nova/etc/nova/:/etc/nova/:ro
environment:
- PLACEMENT_USER=placement
- NOVA_API_USER=nova_api
- list_join:
- '='
- - 'PLACEMENT_DB_HOST'
- {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
- list_join:
- '='
- - 'PLACEMENT_PASS'
- {get_param: PlacementPassword}
- list_join:
- '='
- - 'NOVA_API_DB_HOST'
- {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
- list_join:
- '='
- - 'NOVA_API_PASS'
- {get_param: NovaPassword}
# NOTE(lyarwood): We can swallow return codes of 0, 3 and 4 as they
# suggest this is a fresh deployment with no data to extract. The
# current list of return codes provided by the migrate script is:
# 0: Success
# 1: Usage error
# 2: Configuration missing or incomplete
# 3: Migration already completed
# 4: No data to migrate from nova (new deployment)
# 5: Unable to connect to one or both databases
# 6: Unable to execute placement's CLI commands
command: "/usr/bin/bootstrap_host_exec placement su placement -s /bin/bash -c 'cd /tmp && /usr/share/placement/mysql-migrate-db.sh --migrate -; ret=$?; if [ $ret -ne 0 ] && [ $ret -ne 3 ] && [ $ret -ne 4 ]; then exit $ret; else exit 0; fi'"
placement_api_db_sync:
start_order: 1
image: &placement_api_image {get_param: DockerPlacementImage}
image: *placement_api_image
net: host
detach: false
user: root
@ -240,3 +288,11 @@ outputs:
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
host_prep_tasks: {get_attr: [PlacementLogging, host_prep_tasks]}
upgrade_tasks: []
post_upgrade_tasks:
- when: step|int == 1
import_role:
name: tripleo-docker-rm
vars:
containers_to_rm:
- nova_placement