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:
@@ -74,6 +74,18 @@ def initConfig(controllerObject):
|
||||
"USE_DEFAULT" : True,
|
||||
"NEED_CONFIRM" : 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",
|
||||
"USAGE" : "Kestone token format. Use either UUID or PKI",
|
||||
"PROMPT" : "Enter the Keystone token format.",
|
||||
|
||||
@@ -59,6 +59,8 @@ def initSequences(controller):
|
||||
|
||||
def createmanifest(config):
|
||||
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
|
||||
manifestdata = getManifestTemplate("openstack_client.pp")
|
||||
appendManifestFile(manifestfile, manifestdata)
|
||||
|
||||
@@ -17,3 +17,16 @@ export OS_AUTH_URL=http://%(CONFIG_KEYSTONE_HOST)s:35357/v2.0/
|
||||
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)]\\$ '
|
||||
",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class { 'openstack::provision':
|
||||
admin_password => '%(CONFIG_KEYSTONE_ADMIN_PW)s',
|
||||
password => '%(CONFIG_KEYSTONE_DEMO_PW)s',
|
||||
configure_tempest => %(CONFIG_PROVISION_TEMPEST)s,
|
||||
setup_ovs_bridge => %(CONFIG_PROVISION_ALL_IN_ONE_OVS_BRIDGE)s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user