cloudstack: cs_template: fix cross_zones template removal
This commit is contained in:
parent
b928ffb5ac
commit
871f586378
1 changed files with 7 additions and 3 deletions
|
@ -89,8 +89,8 @@ options:
|
||||||
default: false
|
default: false
|
||||||
cross_zones:
|
cross_zones:
|
||||||
description:
|
description:
|
||||||
- Whether the template should be syned across zones.
|
- Whether the template should be syned or removed across zones.
|
||||||
- Only used if C(state) is present.
|
- Only used if C(state) is present or absent.
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
project:
|
project:
|
||||||
|
@ -220,6 +220,7 @@ EXAMPLES = '''
|
||||||
- local_action:
|
- local_action:
|
||||||
module: cs_template
|
module: cs_template
|
||||||
name: systemvm-4.2
|
name: systemvm-4.2
|
||||||
|
cross_zones: yes
|
||||||
state: absent
|
state: absent
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
@ -560,7 +561,9 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
|
||||||
|
|
||||||
args = {}
|
args = {}
|
||||||
args['id'] = template['id']
|
args['id'] = template['id']
|
||||||
args['zoneid'] = self.get_zone(key='id')
|
|
||||||
|
if not self.module.params.get('cross_zones'):
|
||||||
|
args['zoneid'] = self.get_zone(key='id')
|
||||||
|
|
||||||
if not self.module.check_mode:
|
if not self.module.check_mode:
|
||||||
res = self.cs.deleteTemplate(**args)
|
res = self.cs.deleteTemplate(**args)
|
||||||
|
@ -620,6 +623,7 @@ def main():
|
||||||
required_together=required_together,
|
required_together=required_together,
|
||||||
mutually_exclusive = (
|
mutually_exclusive = (
|
||||||
['url', 'vm'],
|
['url', 'vm'],
|
||||||
|
['zone', 'cross_zones'],
|
||||||
),
|
),
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue