|
|
@ -127,7 +127,7 @@ def _set_tenant_id(module):
|
|
|
|
for tenant in _os_keystone.tenants.list():
|
|
|
|
for tenant in _os_keystone.tenants.list():
|
|
|
|
if tenant.name == login_tenant_name:
|
|
|
|
if tenant.name == login_tenant_name:
|
|
|
|
_os_tenant_id = tenant.id
|
|
|
|
_os_tenant_id = tenant.id
|
|
|
|
break;
|
|
|
|
break
|
|
|
|
if not _os_tenant_id:
|
|
|
|
if not _os_tenant_id:
|
|
|
|
module.fail_json(msg = "The tenant id cannot be found, please check the paramters")
|
|
|
|
module.fail_json(msg = "The tenant id cannot be found, please check the paramters")
|
|
|
|
|
|
|
|
|
|
|
@ -152,7 +152,7 @@ def _create_router(module, quantum):
|
|
|
|
'admin_state_up': module.params['admin_state_up'],
|
|
|
|
'admin_state_up': module.params['admin_state_up'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
new_router = quantum.create_router({'router': router })
|
|
|
|
new_router = quantum.create_router(dict(router=router))
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
module.fail_json( msg = "Error in creating router: %s" % e.message)
|
|
|
|
module.fail_json( msg = "Error in creating router: %s" % e.message)
|
|
|
|
return new_router['router']['id']
|
|
|
|
return new_router['router']['id']
|
|
|
@ -196,9 +196,6 @@ def main():
|
|
|
|
_delete_router(module, quantum, router_id)
|
|
|
|
_delete_router(module, quantum, router_id)
|
|
|
|
module.exit_json(changed = True, result = "deleted")
|
|
|
|
module.exit_json(changed = True, result = "deleted")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# this is magic, see lib/ansible/module.params['common.py
|
|
|
|
# this is magic, see lib/ansible/module.params['common.py
|
|
|
|
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
|
|
|
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
|
|
|
|
main()
|
|
|
|
main()
|
|
|
|