Remove ECS policies from AWS compute policy

The compute policy was exceeding maximum size and contained
policies that already exist in ecs-policy.

Look up suitable AMIs rather than hardcode

We don't want to maintain multiple image IDs for multiple regions
so use ec2_ami_facts to set a suitable image ID

Improve exception handling
This commit is contained in:
Will Thames 2018-06-06 19:48:00 +10:00
parent fbcd6f8a65
commit a60fe1946c
4 changed files with 15 additions and 57 deletions

View file

@ -523,7 +523,7 @@ def main():
network_configuration,
module.params['launch_type'])
except botocore.exceptions.ClientError as e:
module.fail_json(msg=e.message)
module.fail_json_aws(e, msg="Couldn't create service")
results['service'] = response
@ -548,7 +548,7 @@ def main():
module.params['cluster']
)
except botocore.exceptions.ClientError as e:
module.fail_json(msg=e.message)
module.fail_json_aws(e, msg="Couldn't delete service")
results['changed'] = True
elif module.params['state'] == 'deleting':