mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 12:51:25 -07:00
[AWS] check mode for ec2_elb and elb_instance (#42694)
what ELBs an instance will be deregistered from prior to actually executing
This commit is contained in:
parent
26fd05c288
commit
61b0981341
2 changed files with 12 additions and 8 deletions
|
@ -332,6 +332,7 @@ def main():
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=argument_spec,
|
argument_spec=argument_spec,
|
||||||
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|
||||||
if not HAS_BOTO:
|
if not HAS_BOTO:
|
||||||
|
@ -359,6 +360,7 @@ def main():
|
||||||
msg = "ELB %s does not exist" % elb
|
msg = "ELB %s does not exist" % elb
|
||||||
module.fail_json(msg=msg)
|
module.fail_json(msg=msg)
|
||||||
|
|
||||||
|
if not module.check_mode:
|
||||||
if module.params['state'] == 'present':
|
if module.params['state'] == 'present':
|
||||||
elb_man.register(wait, enable_availability_zone, timeout)
|
elb_man.register(wait, enable_availability_zone, timeout)
|
||||||
elif module.params['state'] == 'absent':
|
elif module.params['state'] == 'absent':
|
||||||
|
|
|
@ -328,6 +328,7 @@ def main():
|
||||||
|
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec=argument_spec,
|
argument_spec=argument_spec,
|
||||||
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|
||||||
if not HAS_BOTO:
|
if not HAS_BOTO:
|
||||||
|
@ -355,6 +356,7 @@ def main():
|
||||||
msg = "ELB %s does not exist" % elb
|
msg = "ELB %s does not exist" % elb
|
||||||
module.fail_json(msg=msg)
|
module.fail_json(msg=msg)
|
||||||
|
|
||||||
|
if not module.check_mode:
|
||||||
if module.params['state'] == 'present':
|
if module.params['state'] == 'present':
|
||||||
elb_man.register(wait, enable_availability_zone, timeout)
|
elb_man.register(wait, enable_availability_zone, timeout)
|
||||||
elif module.params['state'] == 'absent':
|
elif module.params['state'] == 'absent':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue