Build keystonerc_demo for demo user

If provisioning a demo network with a demo keystone user, create
the keystonerc_demo file. Also makes the demo user password
configurable.

Change-Id: I4b85a3389c273dc9d77d0cd6674b9b59f633afa7
This commit is contained in:
Terry Wilson
2013-07-15 17:23:31 -05:00
parent 1ffec0e358
commit d1d744317d
4 changed files with 28 additions and 0 deletions

View File

@@ -74,6 +74,18 @@ def initConfig(controllerObject):
"USE_DEFAULT" : True, "USE_DEFAULT" : True,
"NEED_CONFIRM" : False, "NEED_CONFIRM" : False,
"CONDITION" : False }, "CONDITION" : False },
{"CMD_OPTION" : "keystone-demo-passwd",
"USAGE" : "The password to use for the Keystone demo user",
"PROMPT" : "Enter the password for the Keystone demo user",
"OPTION_LIST" : [],
"VALIDATORS" : [validators.validate_not_empty],
"DEFAULT_VALUE" : uuid.uuid4().hex[:16],
"MASK_INPUT" : True,
"LOOSE_VALIDATION": False,
"CONF_NAME" : "CONFIG_KEYSTONE_DEMO_PW",
"USE_DEFAULT" : True,
"NEED_CONFIRM" : False,
"CONDITION" : False },
{"CMD_OPTION" : "keystone-token-format", {"CMD_OPTION" : "keystone-token-format",
"USAGE" : "Kestone token format. Use either UUID or PKI", "USAGE" : "Kestone token format. Use either UUID or PKI",
"PROMPT" : "Enter the Keystone token format.", "PROMPT" : "Enter the Keystone token format.",

View File

@@ -59,6 +59,8 @@ def initSequences(controller):
def createmanifest(config): def createmanifest(config):
client_host = controller.CONF['CONFIG_OSCLIENT_HOST'].strip() client_host = controller.CONF['CONFIG_OSCLIENT_HOST'].strip()
if controller.CONF.get('CONFIG_PROVISION_DEMO', 'n') != 'y':
controller.CONF['CONFIG_PROVISION_DEMO'] = 'n'
manifestfile = "%s_osclient.pp" % client_host manifestfile = "%s_osclient.pp" % client_host
manifestdata = getManifestTemplate("openstack_client.pp") manifestdata = getManifestTemplate("openstack_client.pp")
appendManifestFile(manifestfile, manifestdata) appendManifestFile(manifestfile, manifestdata)

View File

@@ -17,3 +17,16 @@ export OS_AUTH_URL=http://%(CONFIG_KEYSTONE_HOST)s:35357/v2.0/
export PS1='[\\u@\\h \\W(keystone_admin)]\\$ ' export PS1='[\\u@\\h \\W(keystone_admin)]\\$ '
", ",
} }
if '%(CONFIG_PROVISION_DEMO)s' == 'y' {
file {"${::home_dir}/keystonerc_demo":
ensure => "present",
mode => '0600',
content => "export OS_USERNAME=demo
export OS_TENANT_NAME=demo
export OS_PASSWORD=%(CONFIG_KEYSTONE_DEMO_PW)s
export OS_AUTH_URL=http://%(CONFIG_KEYSTONE_HOST)s:35357/v2.0/
export PS1='[\\u@\\h \\W(keystone_demo)]\\$ '
",
}
}

View File

@@ -1,5 +1,6 @@
class { 'openstack::provision': class { 'openstack::provision':
admin_password => '%(CONFIG_KEYSTONE_ADMIN_PW)s', admin_password => '%(CONFIG_KEYSTONE_ADMIN_PW)s',
password => '%(CONFIG_KEYSTONE_DEMO_PW)s',
configure_tempest => %(CONFIG_PROVISION_TEMPEST)s, configure_tempest => %(CONFIG_PROVISION_TEMPEST)s,
setup_ovs_bridge => %(CONFIG_PROVISION_ALL_IN_ONE_OVS_BRIDGE)s setup_ovs_bridge => %(CONFIG_PROVISION_ALL_IN_ONE_OVS_BRIDGE)s
} }