mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 10:40:22 -07:00
Docs standardization/style
This commit is contained in:
parent
ab4b45df3f
commit
548063a617
1 changed files with 20 additions and 19 deletions
|
@ -37,12 +37,12 @@ options:
|
||||||
description:
|
description:
|
||||||
- Password of login user
|
- Password of login user
|
||||||
required: true
|
required: true
|
||||||
default: True
|
default: 'yes'
|
||||||
login_tenant_name:
|
login_tenant_name:
|
||||||
description:
|
description:
|
||||||
- The tenant name of the login user
|
- The tenant name of the login user
|
||||||
required: true
|
required: true
|
||||||
default: True
|
default: 'yes'
|
||||||
auth_url:
|
auth_url:
|
||||||
description:
|
description:
|
||||||
- The keystone url for authentication
|
- The keystone url for authentication
|
||||||
|
@ -193,7 +193,7 @@ def _remove_interface_router(quantum, module, router_id, subnet_id):
|
||||||
try:
|
try:
|
||||||
quantum.remove_interface_router(router_id, kwargs)
|
quantum.remove_interface_router(router_id, kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
module.fail_json(msg = "Error in removing interface from router: %s" % e.message)
|
module.fail_json(msg="Error in removing interface from router: %s" % e.message)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -213,27 +213,28 @@ def main():
|
||||||
|
|
||||||
quantum = _get_quantum_client(module, module.params)
|
quantum = _get_quantum_client(module, module.params)
|
||||||
_set_tenant_id(module)
|
_set_tenant_id(module)
|
||||||
|
|
||||||
router_id = _get_router_id(module, quantum)
|
router_id = _get_router_id(module, quantum)
|
||||||
if not router_id:
|
if not router_id:
|
||||||
module.fail_json(msg = "failed to get the router id, please check the router name")
|
module.fail_json(msg="failed to get the router id, please check the router name")
|
||||||
|
|
||||||
subnet_id = _get_subnet_id(module, quantum)
|
subnet_id = _get_subnet_id(module, quantum)
|
||||||
if not subnet_id:
|
if not subnet_id:
|
||||||
module.fail_json(msg = "failed to get the subnet id, please check the subnet name")
|
module.fail_json(msg="failed to get the subnet id, please check the subnet name")
|
||||||
|
|
||||||
if module.params['state'] == 'present':
|
if module.params['state'] == 'present':
|
||||||
port_id = _get_port_id(quantum, module, router_id, subnet_id)
|
port_id = _get_port_id(quantum, module, router_id, subnet_id)
|
||||||
if not port_id:
|
if not port_id:
|
||||||
_add_interface_router(quantum, module, router_id, subnet_id)
|
_add_interface_router(quantum, module, router_id, subnet_id)
|
||||||
module.exit_json(changed = True, result = "created", id = port_id)
|
module.exit_json(changed=True, result="created", id=port_id)
|
||||||
module.exit_json(changed = False, result = "success", id = port_id)
|
module.exit_json(changed=False, result="success", id=port_id)
|
||||||
|
|
||||||
if module.params['state'] == 'absent':
|
if module.params['state'] == 'absent':
|
||||||
port_id = _get_port_id(quantum, module, router_id, subnet_id)
|
port_id = _get_port_id(quantum, module, router_id, subnet_id)
|
||||||
if not port_id:
|
if not port_id:
|
||||||
module.exit_json(changed = False, result = "Sucess")
|
module.exit_json(changed = False, result = "Sucess")
|
||||||
_remove_interface_router(quantum, module, router_id, subnet_id)
|
_remove_interface_router(quantum, module, router_id, subnet_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>>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue