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

This commit is contained in:
Matt Martz 2014-01-23 19:54:37 -06:00
parent d7597414b8
commit bc473c5be3

View file

@ -2,11 +2,16 @@ import os
def rax_argument_spec():
auth_endpoint = 'https://identity.api.rackspacecloud.com/v2.0/'
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']),
identity_type=dict(type='str', default='rackspace'),
region=dict(type='str'),
tenant_id=dict(type='str'),
username=dict(type='str'),
verify_ssl=dict(choices=BOOLEANS, default=True, type='bool'),
)
@ -16,9 +21,19 @@ def rax_required_together():
def setup_rax_module(module, rax_module):
api_key = module.params.get('api_key')
auth_endpoint = module.params.get('auth_endpoint')
credentials = module.params.get('credentials')
identity_type = module.params.get('identity_type')
region = module.params.get('region')
tenant_id = module.params.get('tenant_id')
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:
username = username or os.environ.get('RAX_USERNAME')