mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Resolves issue#6067 by allowing exact_count=0
This commit is contained in:
parent
5272eab40c
commit
dbd3194e9c
1 changed files with 5 additions and 5 deletions
|
@ -1035,7 +1035,7 @@ def main():
|
||||||
instance_profile_name = dict(),
|
instance_profile_name = dict(),
|
||||||
instance_ids = dict(type='list'),
|
instance_ids = dict(type='list'),
|
||||||
state = dict(default='present'),
|
state = dict(default='present'),
|
||||||
exact_count = dict(type='int'),
|
exact_count = dict(type='int', default=None),
|
||||||
count_tag = dict(),
|
count_tag = dict(),
|
||||||
volumes = dict(type='list'),
|
volumes = dict(type='list'),
|
||||||
)
|
)
|
||||||
|
@ -1071,11 +1071,11 @@ def main():
|
||||||
# Changed is always set to true when provisioning new instances
|
# Changed is always set to true when provisioning new instances
|
||||||
if not module.params.get('image'):
|
if not module.params.get('image'):
|
||||||
module.fail_json(msg='image parameter is required for new instance')
|
module.fail_json(msg='image parameter is required for new instance')
|
||||||
|
|
||||||
if module.params.get('exact_count'):
|
if module.params.get('exact_count') is None:
|
||||||
(tagged_instances, instance_dict_array, new_instance_ids, changed) = enforce_count(module, ec2)
|
|
||||||
else:
|
|
||||||
(instance_dict_array, new_instance_ids, changed) = create_instances(module, ec2)
|
(instance_dict_array, new_instance_ids, changed) = create_instances(module, ec2)
|
||||||
|
else:
|
||||||
|
(tagged_instances, instance_dict_array, new_instance_ids, changed) = enforce_count(module, ec2)
|
||||||
|
|
||||||
module.exit_json(changed=changed, instance_ids=new_instance_ids, instances=instance_dict_array, tagged_instances=tagged_instances)
|
module.exit_json(changed=changed, instance_ids=new_instance_ids, instances=instance_dict_array, tagged_instances=tagged_instances)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue