From f70a6a47decef008c4fa6fe01f1db6dd91928f7d Mon Sep 17 00:00:00 2001 From: Manabu Ori Date: Mon, 29 Sep 2014 13:40:20 +0900 Subject: [PATCH] Add CONFIG_KEYSTONE_REGION option. This changeset makes packstack to support region name other than 'RegionOne'. Change-Id: Ib304c4c0a500d0f11dd9033eafa43251b604cdf1 --- docs/packstack.rst | 3 +++ packstack/plugins/keystone_100.py | 13 +++++++++++++ packstack/puppet/templates/keystone.pp | 1 + packstack/puppet/templates/keystone_ceilometer.pp | 1 + packstack/puppet/templates/keystone_cinder.pp | 1 + packstack/puppet/templates/keystone_glance.pp | 1 + packstack/puppet/templates/keystone_heat.pp | 1 + packstack/puppet/templates/keystone_neutron.pp | 1 + packstack/puppet/templates/keystone_nova.pp | 1 + packstack/puppet/templates/keystone_swift.pp | 1 + packstack/puppet/templates/neutron_metadata.pp | 1 + packstack/puppet/templates/neutron_notifications.pp | 1 + packstack/puppet/templates/nova_neutron.pp | 1 + packstack/puppet/templates/openstack_client.pp | 1 + 14 files changed, 28 insertions(+) diff --git a/docs/packstack.rst b/docs/packstack.rst index 018f31515..83578e813 100644 --- a/docs/packstack.rst +++ b/docs/packstack.rst @@ -132,6 +132,9 @@ AMQP Config parameters Keystone Config parameters -------------------------- +**CONFIG_KEYSTONE_REGION** + The region name to use for the Keystone. + **CONFIG_KEYSTONE_DB_PW** The password to use for the Keystone to access DB. diff --git a/packstack/plugins/keystone_100.py b/packstack/plugins/keystone_100.py index ab3ea54c1..c939f584d 100644 --- a/packstack/plugins/keystone_100.py +++ b/packstack/plugins/keystone_100.py @@ -38,6 +38,19 @@ def initConfig(controller): "NEED_CONFIRM": True, "CONDITION": False}, + {"CMD_OPTION": "keystone-region", + "USAGE": "Region name", + "PROMPT": "Region name", + "OPTION_LIST": [], + "VALIDATORS": [validators.validate_not_empty], + "DEFAULT_VALUE": "RegionOne", + "MASK_INPUT": False, + "LOOSE_VALIDATION": False, + "CONF_NAME": "CONFIG_KEYSTONE_REGION", + "USE_DEFAULT": True, + "NEED_CONFIRM": False, + "CONDITION": False}, + {"CMD_OPTION": "keystone-admin-token", "USAGE": "The token to use for the Keystone service api", "PROMPT": "The token to use for the Keystone service api", diff --git a/packstack/puppet/templates/keystone.pp b/packstack/puppet/templates/keystone.pp index fe056583b..8464c66a3 100644 --- a/packstack/puppet/templates/keystone.pp +++ b/packstack/puppet/templates/keystone.pp @@ -15,6 +15,7 @@ class {"keystone::roles::admin": } class {"keystone::endpoint": + region => "%(CONFIG_KEYSTONE_REGION)s", public_address => "%(CONFIG_CONTROLLER_HOST)s", admin_address => "%(CONFIG_CONTROLLER_HOST)s", internal_address => "%(CONFIG_CONTROLLER_HOST)s", diff --git a/packstack/puppet/templates/keystone_ceilometer.pp b/packstack/puppet/templates/keystone_ceilometer.pp index fc3ce356e..5fbf12fc5 100644 --- a/packstack/puppet/templates/keystone_ceilometer.pp +++ b/packstack/puppet/templates/keystone_ceilometer.pp @@ -1,5 +1,6 @@ class { 'ceilometer::keystone::auth': + region => '%(CONFIG_KEYSTONE_REGION)s', password => '%(CONFIG_CEILOMETER_KS_PW)s', public_address => "%(CONFIG_CONTROLLER_HOST)s", admin_address => "%(CONFIG_CONTROLLER_HOST)s", diff --git a/packstack/puppet/templates/keystone_cinder.pp b/packstack/puppet/templates/keystone_cinder.pp index 0270adb3f..c175f45ae 100644 --- a/packstack/puppet/templates/keystone_cinder.pp +++ b/packstack/puppet/templates/keystone_cinder.pp @@ -1,5 +1,6 @@ class {"cinder::keystone::auth": + region => "%(CONFIG_KEYSTONE_REGION)s", password => "%(CONFIG_CINDER_KS_PW)s", public_address => "%(CONFIG_STORAGE_HOST)s", admin_address => "%(CONFIG_STORAGE_HOST)s", diff --git a/packstack/puppet/templates/keystone_glance.pp b/packstack/puppet/templates/keystone_glance.pp index 4249a2623..1d907acf2 100644 --- a/packstack/puppet/templates/keystone_glance.pp +++ b/packstack/puppet/templates/keystone_glance.pp @@ -1,5 +1,6 @@ class {"glance::keystone::auth": + region => "%(CONFIG_KEYSTONE_REGION)s", password => "%(CONFIG_GLANCE_KS_PW)s", public_address => "%(CONFIG_STORAGE_HOST)s", admin_address => "%(CONFIG_STORAGE_HOST)s", diff --git a/packstack/puppet/templates/keystone_heat.pp b/packstack/puppet/templates/keystone_heat.pp index 9b86f905f..d05acd11f 100644 --- a/packstack/puppet/templates/keystone_heat.pp +++ b/packstack/puppet/templates/keystone_heat.pp @@ -1,5 +1,6 @@ # heat::keystone::auth class {"heat::keystone::auth": + region => "%(CONFIG_KEYSTONE_REGION)s", password => "%(CONFIG_HEAT_KS_PW)s", public_address => "%(CONFIG_CONTROLLER_HOST)s", admin_address => "%(CONFIG_CONTROLLER_HOST)s", diff --git a/packstack/puppet/templates/keystone_neutron.pp b/packstack/puppet/templates/keystone_neutron.pp index 4699a9150..07842c84f 100644 --- a/packstack/puppet/templates/keystone_neutron.pp +++ b/packstack/puppet/templates/keystone_neutron.pp @@ -1,5 +1,6 @@ class {"neutron::keystone::auth": + region => "%(CONFIG_KEYSTONE_REGION)s", password => "%(CONFIG_NEUTRON_KS_PW)s", public_address => "%(CONFIG_CONTROLLER_HOST)s", admin_address => "%(CONFIG_CONTROLLER_HOST)s", diff --git a/packstack/puppet/templates/keystone_nova.pp b/packstack/puppet/templates/keystone_nova.pp index ccca515d4..f544bf933 100644 --- a/packstack/puppet/templates/keystone_nova.pp +++ b/packstack/puppet/templates/keystone_nova.pp @@ -1,5 +1,6 @@ class {"nova::keystone::auth": + region => "%(CONFIG_KEYSTONE_REGION)s", password => "%(CONFIG_NOVA_KS_PW)s", public_address => "%(CONFIG_CONTROLLER_HOST)s", admin_address => "%(CONFIG_CONTROLLER_HOST)s", diff --git a/packstack/puppet/templates/keystone_swift.pp b/packstack/puppet/templates/keystone_swift.pp index a5de90d3d..be71587eb 100644 --- a/packstack/puppet/templates/keystone_swift.pp +++ b/packstack/puppet/templates/keystone_swift.pp @@ -1,4 +1,5 @@ class { 'swift::keystone::auth': public_address => '%(CONFIG_CONTROLLER_HOST)s', + region => '%(CONFIG_KEYSTONE_REGION)s', password => '%(CONFIG_SWIFT_KS_PW)s', } diff --git a/packstack/puppet/templates/neutron_metadata.pp b/packstack/puppet/templates/neutron_metadata.pp index dc83b1e54..9db8cc8be 100644 --- a/packstack/puppet/templates/neutron_metadata.pp +++ b/packstack/puppet/templates/neutron_metadata.pp @@ -1,6 +1,7 @@ class {'neutron::agents::metadata': auth_password => '%(CONFIG_NEUTRON_KS_PW)s', auth_url => 'http://%(CONFIG_CONTROLLER_HOST)s:35357/v2.0', + auth_region => '%(CONFIG_KEYSTONE_REGION)s', shared_secret => '%(CONFIG_NEUTRON_METADATA_PW)s', metadata_ip => '%(CONFIG_CONTROLLER_HOST)s', debug => %(CONFIG_DEBUG_MODE)s, diff --git a/packstack/puppet/templates/neutron_notifications.pp b/packstack/puppet/templates/neutron_notifications.pp index d8d13a1b0..36983512a 100644 --- a/packstack/puppet/templates/neutron_notifications.pp +++ b/packstack/puppet/templates/neutron_notifications.pp @@ -5,4 +5,5 @@ class { 'neutron::server::notifications': nova_admin_tenant_name => 'services', nova_url => 'http://%(CONFIG_CONTROLLER_HOST)s:8774/v2', nova_admin_auth_url => 'http://%(CONFIG_CONTROLLER_HOST)s:35357/v2.0', + nova_region_name => '%(CONFIG_KEYSTONE_REGION)s', } diff --git a/packstack/puppet/templates/nova_neutron.pp b/packstack/puppet/templates/nova_neutron.pp index e2b3babd3..4e4e054a7 100644 --- a/packstack/puppet/templates/nova_neutron.pp +++ b/packstack/puppet/templates/nova_neutron.pp @@ -5,6 +5,7 @@ class {"nova::network::neutron": neutron_url => "http://%(CONFIG_CONTROLLER_HOST)s:9696", neutron_admin_tenant_name => "services", neutron_admin_auth_url => "http://%(CONFIG_CONTROLLER_HOST)s:35357/v2.0", + neutron_region_name => "%(CONFIG_KEYSTONE_REGION)s", } class {"nova::compute::neutron": diff --git a/packstack/puppet/templates/openstack_client.pp b/packstack/puppet/templates/openstack_client.pp index 86b8333af..350c7672b 100644 --- a/packstack/puppet/templates/openstack_client.pp +++ b/packstack/puppet/templates/openstack_client.pp @@ -9,6 +9,7 @@ $rcadmin_content = "export OS_USERNAME=admin export OS_TENANT_NAME=admin export OS_PASSWORD=%(CONFIG_KEYSTONE_ADMIN_PW)s export OS_AUTH_URL=http://%(CONFIG_CONTROLLER_HOST)s:5000/v2.0/ +export OS_REGION_NAME=%(CONFIG_KEYSTONE_REGION)s export PS1='[\\u@\\h \\W(keystone_admin)]\\$ ' "