|
|
@ -36,11 +36,12 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Name of the affinity group.
|
|
|
|
- Name of the affinity group.
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
affinty_type:
|
|
|
|
affinity_type:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Type of the affinity group. If not specified, first found affinity type is used.
|
|
|
|
- Type of the affinity group. If not specified, first found affinity type is used.
|
|
|
|
required: false
|
|
|
|
required: false
|
|
|
|
default: null
|
|
|
|
default: null
|
|
|
|
|
|
|
|
aliases: [ affinty_type ]
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Description of the affinity group.
|
|
|
|
- Description of the affinity group.
|
|
|
@ -80,7 +81,7 @@ EXAMPLES = '''
|
|
|
|
- local_action:
|
|
|
|
- local_action:
|
|
|
|
module: cs_affinitygroup
|
|
|
|
module: cs_affinitygroup
|
|
|
|
name: haproxy
|
|
|
|
name: haproxy
|
|
|
|
affinty_type: host anti-affinity
|
|
|
|
affinity_type: host anti-affinity
|
|
|
|
|
|
|
|
|
|
|
|
# Remove a affinity group
|
|
|
|
# Remove a affinity group
|
|
|
|
- local_action:
|
|
|
|
- local_action:
|
|
|
@ -160,7 +161,7 @@ class AnsibleCloudStackAffinityGroup(AnsibleCloudStack):
|
|
|
|
return self.affinity_group
|
|
|
|
return self.affinity_group
|
|
|
|
|
|
|
|
|
|
|
|
def get_affinity_type(self):
|
|
|
|
def get_affinity_type(self):
|
|
|
|
affinity_type = self.module.params.get('affinty_type')
|
|
|
|
affinity_type = self.module.params.get('affinity_type') or self.module.params.get('affinty_type')
|
|
|
|
|
|
|
|
|
|
|
|
affinity_types = self.query_api('listAffinityGroupTypes', )
|
|
|
|
affinity_types = self.query_api('listAffinityGroupTypes', )
|
|
|
|
if affinity_types:
|
|
|
|
if affinity_types:
|
|
|
@ -217,7 +218,8 @@ def main():
|
|
|
|
argument_spec = cs_argument_spec()
|
|
|
|
argument_spec = cs_argument_spec()
|
|
|
|
argument_spec.update(dict(
|
|
|
|
argument_spec.update(dict(
|
|
|
|
name=dict(required=True),
|
|
|
|
name=dict(required=True),
|
|
|
|
affinty_type=dict(),
|
|
|
|
affinty_type=dict(removed_in_version='2.9'),
|
|
|
|
|
|
|
|
affinity_type=dict(),
|
|
|
|
description=dict(),
|
|
|
|
description=dict(),
|
|
|
|
state=dict(choices=['present', 'absent'], default='present'),
|
|
|
|
state=dict(choices=['present', 'absent'], default='present'),
|
|
|
|
domain=dict(),
|
|
|
|
domain=dict(),
|
|
|
@ -229,6 +231,9 @@ def main():
|
|
|
|
module = AnsibleModule(
|
|
|
|
module = AnsibleModule(
|
|
|
|
argument_spec=argument_spec,
|
|
|
|
argument_spec=argument_spec,
|
|
|
|
required_together=cs_required_together(),
|
|
|
|
required_together=cs_required_together(),
|
|
|
|
|
|
|
|
mutually_exclusive=(
|
|
|
|
|
|
|
|
['affinity_type', 'affinty_type'],
|
|
|
|
|
|
|
|
),
|
|
|
|
supports_check_mode=True
|
|
|
|
supports_check_mode=True
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|