Merge pull request #848 from resmo/for-ansible
cloudstack: updates and fixes
This commit is contained in:
commit
785cd24a02
7 changed files with 32 additions and 35 deletions
|
@ -801,7 +801,7 @@ def main():
|
|||
disk_size = dict(type='int', default=None),
|
||||
root_disk_size = dict(type='int', default=None),
|
||||
keyboard = dict(choices=['de', 'de-ch', 'es', 'fi', 'fr', 'fr-be', 'fr-ch', 'is', 'it', 'jp', 'nl-be', 'no', 'pt', 'uk', 'us'], default=None),
|
||||
hypervisor = dict(choices=['KVM', 'VMware', 'BareMetal', 'XenServer', 'LXC', 'HyperV', 'UCS', 'OVM'], default=None),
|
||||
hypervisor = dict(choices=['KVM', 'VMware', 'BareMetal', 'XenServer', 'LXC', 'HyperV', 'UCS', 'OVM', 'Simulator'], default=None),
|
||||
security_groups = dict(type='list', aliases=[ 'security_group' ], default=[]),
|
||||
affinity_groups = dict(type='list', aliases=[ 'affinity_group' ], default=[]),
|
||||
domain = dict(default=None),
|
||||
|
|
|
@ -150,7 +150,7 @@ name:
|
|||
returned: success
|
||||
type: string
|
||||
sample: Debian 7 64-bit
|
||||
displaytext:
|
||||
display_text:
|
||||
description: Text to be displayed of the ISO.
|
||||
returned: success
|
||||
type: string
|
||||
|
|
|
@ -31,10 +31,10 @@ options:
|
|||
description:
|
||||
- Name (case sensitive) of the network.
|
||||
required: true
|
||||
displaytext:
|
||||
display_text:
|
||||
description:
|
||||
- Displaytext of the network.
|
||||
- If not specified, C(name) will be used as displaytext.
|
||||
- Display text of the network.
|
||||
- If not specified, C(name) will be used as C(display_text).
|
||||
required: false
|
||||
default: null
|
||||
network_offering:
|
||||
|
@ -177,7 +177,7 @@ EXAMPLES = '''
|
|||
- local_action:
|
||||
module: cs_network
|
||||
name: my network
|
||||
displaytext: network of domain example.local
|
||||
display_text: network of domain example.local
|
||||
network_domain: example.local
|
||||
|
||||
# restart a network with clean up
|
||||
|
@ -206,7 +206,7 @@ name:
|
|||
returned: success
|
||||
type: string
|
||||
sample: web project
|
||||
displaytext:
|
||||
display_text:
|
||||
description: Display text of the network.
|
||||
returned: success
|
||||
type: string
|
||||
|
@ -281,7 +281,7 @@ acl_type:
|
|||
returned: success
|
||||
type: string
|
||||
sample: Account
|
||||
broadcast_domaintype:
|
||||
broadcast_domain_type:
|
||||
description: Broadcast domain type of the network.
|
||||
returned: success
|
||||
type: string
|
||||
|
@ -344,7 +344,7 @@ class AnsibleCloudStackNetwork(AnsibleCloudStack):
|
|||
'gateway': 'gateway',
|
||||
'cidr': 'cidr',
|
||||
'netmask': 'netmask',
|
||||
'broadcastdomaintype': 'broadcast_domaintype',
|
||||
'broadcastdomaintype': 'broadcast_domain_type',
|
||||
'dns1': 'dns1',
|
||||
'dns2': 'dns2',
|
||||
}
|
||||
|
@ -390,7 +390,7 @@ class AnsibleCloudStackNetwork(AnsibleCloudStack):
|
|||
def _get_args(self):
|
||||
args = {}
|
||||
args['name'] = self.module.params.get('name')
|
||||
args['displaytext'] = self.get_or_fallback('displaytext', 'name')
|
||||
args['displaytext'] = self.get_or_fallback('display_text', 'name')
|
||||
args['networkdomain'] = self.module.params.get('network_domain')
|
||||
args['networkofferingid'] = self.get_network_offering(key='id')
|
||||
return args
|
||||
|
@ -525,7 +525,7 @@ def main():
|
|||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
name = dict(required=True),
|
||||
displaytext = dict(default=None),
|
||||
display_text = dict(default=None),
|
||||
network_offering = dict(default=None),
|
||||
zone = dict(default=None),
|
||||
start_ip = dict(default=None),
|
||||
|
|
|
@ -31,10 +31,10 @@ options:
|
|||
description:
|
||||
- Name of the project.
|
||||
required: true
|
||||
displaytext:
|
||||
display_text:
|
||||
description:
|
||||
- Displaytext of the project.
|
||||
- If not specified, C(name) will be used as displaytext.
|
||||
- Display text of the project.
|
||||
- If not specified, C(name) will be used as C(display_text).
|
||||
required: false
|
||||
default: null
|
||||
state:
|
||||
|
@ -71,7 +71,7 @@ EXAMPLES = '''
|
|||
- local_action:
|
||||
module: cs_project
|
||||
name: web
|
||||
displaytext: my web project
|
||||
display_text: my web project
|
||||
|
||||
# Suspend an existing project
|
||||
- local_action:
|
||||
|
@ -104,7 +104,7 @@ name:
|
|||
returned: success
|
||||
type: string
|
||||
sample: web project
|
||||
displaytext:
|
||||
display_text:
|
||||
description: Display text of the project.
|
||||
returned: success
|
||||
type: string
|
||||
|
@ -173,7 +173,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack):
|
|||
def update_project(self, project):
|
||||
args = {}
|
||||
args['id'] = project['id']
|
||||
args['displaytext'] = self.get_or_fallback('displaytext', 'name')
|
||||
args['displaytext'] = self.get_or_fallback('display_text', 'name')
|
||||
|
||||
if self._has_changed(args, project):
|
||||
self.result['changed'] = True
|
||||
|
@ -194,7 +194,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack):
|
|||
|
||||
args = {}
|
||||
args['name'] = self.module.params.get('name')
|
||||
args['displaytext'] = self.get_or_fallback('displaytext', 'name')
|
||||
args['displaytext'] = self.get_or_fallback('display_text', 'name')
|
||||
args['account'] = self.get_account('name')
|
||||
args['domainid'] = self.get_domain('id')
|
||||
|
||||
|
@ -262,7 +262,7 @@ def main():
|
|||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
name = dict(required=True),
|
||||
displaytext = dict(default=None),
|
||||
display_text = dict(default=None),
|
||||
state = dict(choices=['present', 'absent', 'active', 'suspended' ], default='present'),
|
||||
domain = dict(default=None),
|
||||
account = dict(default=None),
|
||||
|
|
|
@ -199,7 +199,7 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
|
|||
'icmptype': 'icmp_type',
|
||||
'icmpcode': 'icmp_code',
|
||||
'endport': 'end_port',
|
||||
'start_port': 'start_port',
|
||||
'startport': 'start_port',
|
||||
'protocol': 'protocol',
|
||||
'cidr': 'cidr',
|
||||
'securitygroupname': 'user_security_group',
|
||||
|
|
|
@ -158,9 +158,9 @@ options:
|
|||
- 32 or 64 bits support.
|
||||
required: false
|
||||
default: '64'
|
||||
displaytext:
|
||||
display_text:
|
||||
description:
|
||||
- the display text of the template.
|
||||
- Display text of the template.
|
||||
required: true
|
||||
default: null
|
||||
state:
|
||||
|
@ -229,8 +229,8 @@ name:
|
|||
returned: success
|
||||
type: string
|
||||
sample: Debian 7 64-bit
|
||||
displaytext:
|
||||
description: Displaytext of the template.
|
||||
display_text:
|
||||
description: Display text of the template.
|
||||
returned: success
|
||||
type: string
|
||||
sample: Debian 7.7 64-bit minimal 2015-03-19
|
||||
|
@ -371,7 +371,7 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
|
|||
def _get_args(self):
|
||||
args = {}
|
||||
args['name'] = self.module.params.get('name')
|
||||
args['displaytext'] = self.module.params.get('displaytext')
|
||||
args['displaytext'] = self.get_or_fallback('display_text', 'name')
|
||||
args['bits'] = self.module.params.get('bits')
|
||||
args['isdynamicallyscalable'] = self.module.params.get('is_dynamically_scalable')
|
||||
args['isextractable'] = self.module.params.get('is_extractable')
|
||||
|
@ -385,8 +385,6 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
|
|||
if not args['ostypeid']:
|
||||
self.module.fail_json(msg="Missing required arguments: os_type")
|
||||
|
||||
if not args['displaytext']:
|
||||
args['displaytext'] = self.module.params.get('name')
|
||||
return args
|
||||
|
||||
|
||||
|
@ -523,7 +521,7 @@ def main():
|
|||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
name = dict(required=True),
|
||||
displaytext = dict(default=None),
|
||||
display_text = dict(default=None),
|
||||
url = dict(default=None),
|
||||
vm = dict(default=None),
|
||||
snapshot = dict(default=None),
|
||||
|
@ -536,7 +534,7 @@ def main():
|
|||
is_routing = dict(type='bool', choices=BOOLEANS, default=False),
|
||||
checksum = dict(default=None),
|
||||
template_filter = dict(default='self', choices=['featured', 'self', 'selfexecutable', 'sharedexecutable', 'executable', 'community']),
|
||||
hypervisor = dict(choices=['KVM', 'VMware', 'BareMetal', 'XenServer', 'LXC', 'HyperV', 'UCS', 'OVM'], default=None),
|
||||
hypervisor = dict(choices=['KVM', 'VMware', 'BareMetal', 'XenServer', 'LXC', 'HyperV', 'UCS', 'OVM', 'Simulator'], default=None),
|
||||
requires_hvm = dict(type='bool', choices=BOOLEANS, default=False),
|
||||
password_enabled = dict(type='bool', choices=BOOLEANS, default=False),
|
||||
template_tag = dict(default=None),
|
||||
|
|
|
@ -29,9 +29,9 @@ author: "René Moser (@resmo)"
|
|||
options:
|
||||
name:
|
||||
description:
|
||||
- Unique Name of the snapshot. In CloudStack terms C(displayname).
|
||||
- Unique Name of the snapshot. In CloudStack terms display name.
|
||||
required: true
|
||||
aliases: ['displayname']
|
||||
aliases: ['display_name']
|
||||
vm:
|
||||
description:
|
||||
- Name of the virtual machine.
|
||||
|
@ -115,8 +115,8 @@ name:
|
|||
returned: success
|
||||
type: string
|
||||
sample: snapshot before update
|
||||
displayname:
|
||||
description: displayname of the snapshot.
|
||||
display_name:
|
||||
description: Display name of the snapshot.
|
||||
returned: success
|
||||
type: string
|
||||
sample: snapshot before update
|
||||
|
@ -141,7 +141,6 @@ type:
|
|||
type: string
|
||||
sample: DiskAndMemory
|
||||
description:
|
||||
description:
|
||||
description: description of vm snapshot
|
||||
returned: success
|
||||
type: string
|
||||
|
@ -260,7 +259,7 @@ class AnsibleCloudStackVmSnapshot(AnsibleCloudStack):
|
|||
def main():
|
||||
module = AnsibleModule(
|
||||
argument_spec = dict(
|
||||
name = dict(required=True, aliases=['displayname']),
|
||||
name = dict(required=True, aliases=['display_name']),
|
||||
vm = dict(required=True),
|
||||
description = dict(default=None),
|
||||
zone = dict(default=None),
|
||||
|
|
Loading…
Reference in a new issue