mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +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:
@@ -230,13 +230,8 @@ def _delete_network(module, net_id, neutron):
|
||||
|
||||
def main():
|
||||
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
login_username = dict(default='admin'),
|
||||
login_password = dict(required=True),
|
||||
login_tenant_name = dict(required='True'),
|
||||
auth_url = dict(default='http://127.0.0.1:35357/v2.0/'),
|
||||
region_name = dict(default=None),
|
||||
argument_spec = openstack_argument_spec()
|
||||
argument_spec.update(dict(
|
||||
name = dict(required=True),
|
||||
tenant_name = dict(default=None),
|
||||
provider_network_type = dict(default=None, choices=['local', 'vlan', 'flat', 'gre']),
|
||||
@@ -246,8 +241,8 @@ def main():
|
||||
shared = dict(default=False, type='bool'),
|
||||
admin_state_up = dict(default=True, type='bool'),
|
||||
state = dict(default='present', choices=['absent', 'present'])
|
||||
),
|
||||
)
|
||||
))
|
||||
module = AnsibleModule(argument_spec=argument_spec)
|
||||
|
||||
if module.params['provider_network_type'] in ['vlan' , 'flat']:
|
||||
if not module.params['provider_physical_network']:
|
||||
@@ -279,5 +274,6 @@ def main():
|
||||
|
||||
# this is magic, see lib/ansible/module.params['common.py
|
||||
from ansible.module_utils.basic import *
|
||||
from ansible.module_utils.openstack import *
|
||||
main()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user