From 42f44640195937b1738b09cecf27f7a1ef8187bd Mon Sep 17 00:00:00 2001 From: Piotr Kopec Date: Tue, 9 Jun 2020 00:22:49 +0200 Subject: [PATCH] [FFU] Use output parameter instead of hiera lookup for cell creation 10-13 FFU step that creates default cell uses hieradata lookup which evaulates to 'nil' for database_connection which causes failure of ffu steps that follows. The database_connection should be set using output parameter from base template. Change-Id: Ib5a6fddc44e7c4e0f0a37e3b0f4275cde46a0861 Closes-Bug: #1882512 --- docker/services/nova-api.yaml | 6 +++++- puppet/services/nova-api.yaml | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/docker/services/nova-api.yaml b/docker/services/nova-api.yaml index d09ca2bc8e..cb359c87bb 100644 --- a/docker/services/nova-api.yaml +++ b/docker/services/nova-api.yaml @@ -430,7 +430,11 @@ outputs: - name: Setup cell_v2 (create default cell) # (owalsh) puppet-nova expects the cell name 'default' # (owalsh) pass the db uri explicitly to avoid https://bugs.launchpad.net/tripleo/+bug/1662344 - shell: nova-manage cell_v2 create_cell --name='default' --database_connection=$(hiera nova::database_connection) + shell: + str_replace: + template: nova-manage cell_v2 create_cell --name='default' --database_connection='CELL' + params: + CELL: {get_attr: [NovaApiBase, role_data, config_settings, "nova::database_connection"]} register: nova_api_create_cell failed_when: nova_api_create_cell.rc not in [0,2] changed_when: nova_api_create_cell.rc == 0 diff --git a/puppet/services/nova-api.yaml b/puppet/services/nova-api.yaml index b6295e91b2..387996255e 100644 --- a/puppet/services/nova-api.yaml +++ b/puppet/services/nova-api.yaml @@ -284,14 +284,22 @@ outputs: when: - step|int == 5 - is_bootstrap_node|bool - shell: nova-manage cell_v2 map_cell0 --database_connection=$(hiera nova::cell0_database_connection) + shell: + str_replace: + template: nova-manage cell_v2 map_cell0 --database_connection='CELL' + params: + CELL: {get_attr: [NovaBase, role_data, config_settings, "nova::cell0_database_connection"]} - name: Setup cell_v2 (create default cell) when: - step|int == 5 - is_bootstrap_node|bool # (owalsh) puppet-nova expects the cell name 'default' # (owalsh) pass the db uri explicitly to avoid https://bugs.launchpad.net/tripleo/+bug/1662344 - shell: nova-manage cell_v2 create_cell --name='default' --database_connection=$(hiera nova::database_connection) + shell: + str_replace: + template: nova-manage cell_v2 create_cell --name='default' --database_connection='CELL' + params: + CELL: {get_attr: [NovaBase, role_data, config_settings, "nova::database_connection"]} register: nova_api_create_cell failed_when: nova_api_create_cell.rc not in [0,2] changed_when: nova_api_create_cell.rc == 0