Standardize module doc

reviewable/pr18780/r1
Michael DeHaan 12 years ago
parent 3cbf40c71e
commit 70ea93653f

@ -38,12 +38,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
@ -225,14 +225,19 @@ def main():
state = dict(default='present', choices=['absent', 'present']) state = dict(default='present', choices=['absent', 'present'])
), ),
) )
if module.params['provider_network_type'] in ['vlan' , 'flat']: if module.params['provider_network_type'] in ['vlan' , 'flat']:
if not module.params['provider_physical_network']: if not module.params['provider_physical_network']:
module.fail_json(msg = " for vlan and flat networks, variable provider_physical_network should be set.") module.fail_json(msg = " for vlan and flat networks, variable provider_physical_network should be set.")
if module.params['provider_network_type'] in ['vlan', 'gre']: if module.params['provider_network_type'] in ['vlan', 'gre']:
if not module.params['provider_segmentation_id']: if not module.params['provider_segmentation_id']:
module.fail_json(msg = " for vlan & gre networks, variable provider_segmentation_id should be set.") module.fail_json(msg = " for vlan & gre networks, variable provider_segmentation_id should be set.")
quantum = _get_quantum_client(module, module.params) quantum = _get_quantum_client(module, module.params)
_set_tenant_id(module) _set_tenant_id(module)
if module.params['state'] == 'present': if module.params['state'] == 'present':
network_id = _get_net_id(quantum, module) network_id = _get_net_id(quantum, module)
if not network_id: if not network_id:
@ -240,6 +245,7 @@ def main():
module.exit_json(changed = True, result = "Created", id = network_id) module.exit_json(changed = True, result = "Created", id = network_id)
else: else:
module.exit_json(changed = False, result = "Success", id = network_id) module.exit_json(changed = False, result = "Success", id = network_id)
if module.params['state'] == 'absent': if module.params['state'] == 'absent':
network_id = _get_net_id(quantum, module) network_id = _get_net_id(quantum, module)
if not network_id: if not network_id:
@ -248,9 +254,6 @@ def main():
_delete_network(module, network_id, quantum) _delete_network(module, network_id, quantum)
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()

Loading…
Cancel
Save