Commit bc473c5b by Matt Martz

Support additional attributes that would allow the rax modules to work with other OpenStack clouds

parent d7597414
...@@ -2,11 +2,16 @@ import os ...@@ -2,11 +2,16 @@ import os
def rax_argument_spec(): def rax_argument_spec():
auth_endpoint = 'https://identity.api.rackspacecloud.com/v2.0/'
return dict( return dict(
api_key=dict(type='str', no_log=True), api_key=dict(type='str', aliases=['password'], no_log=True),
auth_endpoint=dict(type='str', default=auth_endpoint),
credentials=dict(type='str', aliases=['creds_file']), credentials=dict(type='str', aliases=['creds_file']),
identity_type=dict(type='str', default='rackspace'),
region=dict(type='str'), region=dict(type='str'),
tenant_id=dict(type='str'),
username=dict(type='str'), username=dict(type='str'),
verify_ssl=dict(choices=BOOLEANS, default=True, type='bool'),
) )
...@@ -16,9 +21,19 @@ def rax_required_together(): ...@@ -16,9 +21,19 @@ def rax_required_together():
def setup_rax_module(module, rax_module): def setup_rax_module(module, rax_module):
api_key = module.params.get('api_key') api_key = module.params.get('api_key')
auth_endpoint = module.params.get('auth_endpoint')
credentials = module.params.get('credentials') credentials = module.params.get('credentials')
identity_type = module.params.get('identity_type')
region = module.params.get('region') region = module.params.get('region')
tenant_id = module.params.get('tenant_id')
username = module.params.get('username') username = module.params.get('username')
verify_ssl = module.params.get('verify_ssl')
rax_module.set_setting('identity_type', identity_type)
rax_module.set_setting('verify_ssl', verify_ssl)
rax_module.set_setting('auth_endpoint', auth_endpoint)
if tenant_id:
rax_module.set_setting('tenant_id', tenant_id)
try: try:
username = username or os.environ.get('RAX_USERNAME') username = username or os.environ.get('RAX_USERNAME')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment