mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Add common auth handling across openstack modules
Taking a page out of the ec2 config, make sure that all of the OpenStack modules handle the inbound auth config in the same way. The one outlier is keystone wrt auth_url.
This commit is contained in:
@@ -287,11 +287,8 @@ def ensure_role_absent(keystone, uesr, tenant, role, check_mode):
|
||||
|
||||
def main():
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
user=dict(required=False),
|
||||
password=dict(required=False),
|
||||
tenant=dict(required=False),
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
tenant_description=dict(required=False),
|
||||
email=dict(required=False),
|
||||
role=dict(required=False),
|
||||
@@ -302,7 +299,11 @@ def main():
|
||||
login_user=dict(required=False),
|
||||
login_password=dict(required=False),
|
||||
login_tenant_name=dict(required=False)
|
||||
),
|
||||
))
|
||||
# keystone operations themselves take an endpoint, not a keystone auth_url
|
||||
del(argument_spec['auth_url'])
|
||||
module = AnsibleModule(
|
||||
argument_spec=argument_spec,
|
||||
supports_check_mode=True,
|
||||
mutually_exclusive=[['token', 'login_user'],
|
||||
['token', 'login_password'],
|
||||
@@ -388,5 +389,6 @@ def dispatch(keystone, user=None, password=None, tenant=None,
|
||||
|
||||
# import module snippets
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.openstack import *
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user