Merge pull request #877 from resmo/for-ansible
cloudstack: fixes and consistency change
This commit is contained in:
commit
e96a2cf9fc
4 changed files with 8 additions and 8 deletions
|
@ -37,7 +37,7 @@ options:
|
||||||
- Network domain for networks in the domain.
|
- Network domain for networks in the domain.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
cleanup:
|
clean_up:
|
||||||
description:
|
description:
|
||||||
- Clean up all domain resources like child domains and accounts.
|
- Clean up all domain resources like child domains and accounts.
|
||||||
- Considered on C(state=absent).
|
- Considered on C(state=absent).
|
||||||
|
@ -225,7 +225,7 @@ class AnsibleCloudStackDomain(AnsibleCloudStack):
|
||||||
if not self.module.check_mode:
|
if not self.module.check_mode:
|
||||||
args = {}
|
args = {}
|
||||||
args['id'] = domain['id']
|
args['id'] = domain['id']
|
||||||
args['cleanup'] = self.module.params.get('cleanup')
|
args['cleanup'] = self.module.params.get('clean_up')
|
||||||
res = self.cs.deleteDomain(**args)
|
res = self.cs.deleteDomain(**args)
|
||||||
|
|
||||||
if 'errortext' in res:
|
if 'errortext' in res:
|
||||||
|
@ -244,7 +244,7 @@ def main():
|
||||||
path = dict(required=True),
|
path = dict(required=True),
|
||||||
state = dict(choices=['present', 'absent'], default='present'),
|
state = dict(choices=['present', 'absent'], default='present'),
|
||||||
network_domain = dict(default=None),
|
network_domain = dict(default=None),
|
||||||
cleanup = dict(choices=BOOLEANS, default=False),
|
clean_up = dict(choices=BOOLEANS, default=False),
|
||||||
poll_async = dict(choices=BOOLEANS, default=True),
|
poll_async = dict(choices=BOOLEANS, default=True),
|
||||||
api_key = dict(default=None),
|
api_key = dict(default=None),
|
||||||
api_secret = dict(default=None, no_log=True),
|
api_secret = dict(default=None, no_log=True),
|
||||||
|
|
|
@ -779,7 +779,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
|
||||||
self.result['affinity_groups'] = affinity_groups
|
self.result['affinity_groups'] = affinity_groups
|
||||||
if 'nic' in instance:
|
if 'nic' in instance:
|
||||||
for nic in instance['nic']:
|
for nic in instance['nic']:
|
||||||
if nic['isdefault']:
|
if nic['isdefault'] and 'ipaddress' in nic:
|
||||||
self.result['default_ip'] = nic['ipaddress']
|
self.result['default_ip'] = nic['ipaddress']
|
||||||
return self.result
|
return self.result
|
||||||
|
|
||||||
|
|
|
@ -361,9 +361,9 @@ class AnsibleCloudStackPortforwarding(AnsibleCloudStack):
|
||||||
super(AnsibleCloudStackPortforwarding, self).get_result(portforwarding_rule)
|
super(AnsibleCloudStackPortforwarding, self).get_result(portforwarding_rule)
|
||||||
if portforwarding_rule:
|
if portforwarding_rule:
|
||||||
# Bad bad API does not always return int when it should.
|
# Bad bad API does not always return int when it should.
|
||||||
for search_key, return_key in returns_to_int.iteritems():
|
for search_key, return_key in self.returns_to_int.iteritems():
|
||||||
if search_key in resource:
|
if search_key in portforwarding_rule:
|
||||||
self.result[return_key] = int(resource[search_key])
|
self.result[return_key] = int(portforwarding_rule[search_key])
|
||||||
return self.result
|
return self.result
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ from ansible.module_utils.cloudstack import *
|
||||||
class AnsibleCloudStackStaticNat(AnsibleCloudStack):
|
class AnsibleCloudStackStaticNat(AnsibleCloudStack):
|
||||||
|
|
||||||
def __init__(self, module):
|
def __init__(self, module):
|
||||||
super(AnsibleCloudStackPortforwarding, self).__init__(module)
|
super(AnsibleCloudStackStaticNat, self).__init__(module)
|
||||||
self.returns = {
|
self.returns = {
|
||||||
'virtualmachinedisplayname': 'vm_display_name',
|
'virtualmachinedisplayname': 'vm_display_name',
|
||||||
'virtualmachinename': 'vm_name',
|
'virtualmachinename': 'vm_name',
|
||||||
|
|
Loading…
Reference in a new issue