Use templating for nova cell transport-url

Nova now allows use of templated urls in the database and mq
connections which will allow static configuration elements to be
applied to the urls read from the database per-node. This should
be a simpler and less obscure method of configuring things like
the per-node bind_address necessary for director's HA arrangement.

This patch addresses the templated transport_url urls as part 2.

Nova support added here:
https://review.openstack.org/#/c/578163/

Change-Id: I889dcf632b3306ce7e56ac5394884c7c72481833
Related-Bug: 1808134
This commit is contained in:
Martin Schuppert 2018-12-19 15:14:11 +01:00
parent 950640ad52
commit 20b677d70a
2 changed files with 41 additions and 3 deletions

View File

@ -211,10 +211,10 @@ outputs:
DEFID=$(nova-manage cell_v2 list_cells | sed -e '1,3d' -e '$d' | awk -F ' *| *' '$2 == "default" {print $4}')
if [ "$DEFID" ]; then
echo "(cellv2) Updating default cell_v2 cell $DEFID"
su nova -s /bin/bash -c "/usr/bin/nova-manage cell_v2 update_cell --cell_uuid $DEFID --name=default --database_connection='CELLDB'"
su nova -s /bin/bash -c "/usr/bin/nova-manage cell_v2 update_cell --cell_uuid $DEFID --name=default --database_connection='CELLDB' --transport-url='TRANSPORTURL'"
else
echo "(cellv2) Creating default cell_v2 cell"
su nova -s /bin/bash -c "/usr/bin/nova-manage cell_v2 create_cell --name=default --database_connection='CELLDB'"
su nova -s /bin/bash -c "/usr/bin/nova-manage cell_v2 create_cell --name=default --database_connection='CELLDB' --transport-url='TRANSPORTURL'"
fi
params:
CELLDB:
@ -235,6 +235,20 @@ outputs:
- 'nova'
- '?'
- '{query}'
TRANSPORTURL:
list_join:
- ''
- - 'rabbit'
- '://'
- '{username}'
- ':'
- '{password}'
- '@'
- '{hostname}'
- ':5672'
- '/'
- '?'
- '{query}'
docker_config:
step_2:
get_attr: [NovaApiLogging, docker_config, step_2]
@ -479,7 +493,7 @@ outputs:
- name: Setup cell_v2 (map cell0)
shell:
str_replace:
template: nova-manage cell_v2 map_cell0 --database_connection='CELL0DB'
template: nova-manage cell_v2 map_cell0 --database_connection='CELL0DB' --transport-url='TRANSPORTURL'
params:
CELL0DB:
list_join:
@ -499,6 +513,20 @@ outputs:
- 'nova_cell0'
- '?'
- '{query}'
TRANSPORTURL:
list_join:
- ''
- - 'rabbit'
- '://'
- '{username}'
- ':'
- '{password}'
- '@'
- '{hostname}'
- ':5672'
- '/'
- '?'
- '{query}'
- name: Setup cell_v2 (create default cell)
# (owalsh) puppet-nova expects the cell name 'default'
shell:

View File

@ -0,0 +1,10 @@
---
features:
- |
Nova now allows use of templated urls in the database and mq
connections which will allow static configuration elements to be
applied to the urls read from the database per-node. This should
be a simpler and less obscure method of configuring things like
the per-node bind_address necessary for director's HA arrangement.
This patch addresses the templated transport urls as part 2.
Nova support added here - https://review.openstack.org/578163