From 494a5b7e5e8307a246d889f53a10e631316f92fa Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Wed, 27 Sep 2017 09:40:40 +0100 Subject: [PATCH] Fix cinder_service_region undefined Due to the simplification of group vars [1], we've removed the definition of cinder_service_region for magnum. We could put cinder_service_region in all group vars instead, but it looks like the scoping is done wrong. We should instead rely on save defaults on the role, that can be overriden. Here, we introduce the variable magnum_cinder_service_region, which defaults to magnum_service_region, i.e. "RegionOne". We can remove the need for an override that way, and properly scope variables. [1]: https://review.openstack.org/#/c/504804/18/group_vars/all/cinder.yml Depends-On: Ia8417bbdac3f515e42d1ed760110a63ae14f8f00 Change-Id: Id25c2d344859adfd09108b759d55f11ae83f97a9 (cherry picked from commit cf0a3c9bac18d09e44c71023b96a2da522adea37) --- defaults/main.yml | 1 + templates/magnum.conf.j2 | 2 +- tests/magnum-test-vars.yml | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 0ab9669..6b07a19 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -40,6 +40,7 @@ magnum_service_project_name: service magnum_service_role_names: - admin magnum_service_region: RegionOne +magnum_cinder_service_region: "{{ magnum_service_region }}" magnum_bind_port: 9511 magnum_service_publicuri_proto: http magnum_service_publicurl: "{{ magnum_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ magnum_bind_port }}" diff --git a/templates/magnum.conf.j2 b/templates/magnum.conf.j2 index ff0225f..de7f01d 100644 --- a/templates/magnum.conf.j2 +++ b/templates/magnum.conf.j2 @@ -12,7 +12,7 @@ host = {{ ansible_host }} endpoint_type = internalURL [cinder_client] -region_name = {{ cinder_service_region }} +region_name = {{ magnum_cinder_service_region }} endpoint_type = internalURL [database] diff --git a/tests/magnum-test-vars.yml b/tests/magnum-test-vars.yml index 702e03b..bdef59c 100644 --- a/tests/magnum-test-vars.yml +++ b/tests/magnum-test-vars.yml @@ -1,6 +1,5 @@ --- magnum_developer_mode: true -cinder_service_region: RegionOne magnum_galera_password: secrete magnum_galera_address: "{{ hostvars[groups['galera_all'][0]]['ansible_host'] }}" magnum_service_password: secrete