mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
cloudstack: cs_ip_address: doc style fixes
This commit is contained in:
parent
88488c26ef
commit
cbaa353a87
1 changed files with 10 additions and 4 deletions
|
@ -21,7 +21,7 @@
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = '''
|
||||||
---
|
---
|
||||||
module: cs_ip_address
|
module: cs_ip_address
|
||||||
short_description: Manages Public/Secondary IP address associations
|
short_description: Manages public IP address associations on Apache CloudStack based clouds.
|
||||||
description:
|
description:
|
||||||
- Acquires and associates a public IP to an account or project. Due to API
|
- Acquires and associates a public IP to an account or project. Due to API
|
||||||
limitations this is not an idempotent call, so be sure to only
|
limitations this is not an idempotent call, so be sure to only
|
||||||
|
@ -31,8 +31,10 @@ author: "Darren Worrall @dazworrall"
|
||||||
options:
|
options:
|
||||||
ip_address:
|
ip_address:
|
||||||
description:
|
description:
|
||||||
- Public IP address. Required if C(state=absent)
|
- Public IP address.
|
||||||
required: true
|
- Required if C(state=absent)
|
||||||
|
required: false
|
||||||
|
default: null
|
||||||
domain:
|
domain:
|
||||||
description:
|
description:
|
||||||
- Domain the IP address is related to.
|
- Domain the IP address is related to.
|
||||||
|
@ -68,7 +70,7 @@ extends_documentation_fragment: cloudstack
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = '''
|
||||||
# Associate an IP address
|
# Associate an IP address conditonally
|
||||||
- local_action:
|
- local_action:
|
||||||
module: cs_ip_address
|
module: cs_ip_address
|
||||||
network: My Network
|
network: My Network
|
||||||
|
@ -148,6 +150,7 @@ class AnsibleCloudStackIPAddress(AnsibleCloudStack):
|
||||||
break
|
break
|
||||||
self.module.fail_json(msg="Network '%s' not found" % network)
|
self.module.fail_json(msg="Network '%s' not found" % network)
|
||||||
|
|
||||||
|
|
||||||
#TODO: Merge changes here with parent class
|
#TODO: Merge changes here with parent class
|
||||||
def get_ip_address(self, key=None):
|
def get_ip_address(self, key=None):
|
||||||
if self.ip_address:
|
if self.ip_address:
|
||||||
|
@ -168,6 +171,7 @@ class AnsibleCloudStackIPAddress(AnsibleCloudStack):
|
||||||
self.ip_address = ip_addresses['publicipaddress'][0]
|
self.ip_address = ip_addresses['publicipaddress'][0]
|
||||||
return self._get_by_key(key, self.ip_address)
|
return self._get_by_key(key, self.ip_address)
|
||||||
|
|
||||||
|
|
||||||
def associate_ip_address(self):
|
def associate_ip_address(self):
|
||||||
self.result['changed'] = True
|
self.result['changed'] = True
|
||||||
args = {}
|
args = {}
|
||||||
|
@ -188,6 +192,7 @@ class AnsibleCloudStackIPAddress(AnsibleCloudStack):
|
||||||
ip_address = res
|
ip_address = res
|
||||||
return ip_address
|
return ip_address
|
||||||
|
|
||||||
|
|
||||||
def disassociate_ip_address(self):
|
def disassociate_ip_address(self):
|
||||||
ip_address = self.get_ip_address()
|
ip_address = self.get_ip_address()
|
||||||
if ip_address is None:
|
if ip_address is None:
|
||||||
|
@ -205,6 +210,7 @@ class AnsibleCloudStackIPAddress(AnsibleCloudStack):
|
||||||
res = self._poll_job(res, 'ipaddress')
|
res = self._poll_job(res, 'ipaddress')
|
||||||
return ip_address
|
return ip_address
|
||||||
|
|
||||||
|
|
||||||
def get_result(self, ip_address):
|
def get_result(self, ip_address):
|
||||||
if ip_address:
|
if ip_address:
|
||||||
if 'zonename' in ip_address:
|
if 'zonename' in ip_address:
|
||||||
|
|
Loading…
Reference in a new issue