1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

ecs_taskdefinition module: containers.environment convert to string (fix #23297) (#23681)

It is to fix the failed comparison of containers.
This commit is contained in:
Takuya Sato 2017-07-14 09:10:31 +09:00 committed by Sloane Hertel
parent a4359d5818
commit 179e2882f7

View file

@ -241,6 +241,11 @@ def main():
task_mgr = EcsTaskManager(module) task_mgr = EcsTaskManager(module)
results = dict(changed=False) results = dict(changed=False)
for container in module.params['containers']:
if 'environment' in container:
for environment in container['environment']:
environment['value'] = str(environment['value'])
if module.params['state'] == 'present': if module.params['state'] == 'present':
if 'containers' not in module.params or not module.params['containers']: if 'containers' not in module.params or not module.params['containers']:
module.fail_json(msg="To use task definitions, a list of containers must be specified") module.fail_json(msg="To use task definitions, a list of containers must be specified")
@ -353,10 +358,6 @@ def main():
if not module.check_mode: if not module.check_mode:
# Doesn't exist. create it. # Doesn't exist. create it.
volumes = module.params.get('volumes', []) or [] volumes = module.params.get('volumes', []) or []
for container in module.params['containers']:
if 'environment' in container:
for environment in container['environment']:
environment['value'] = str(environment['value'])
results['taskdefinition'] = task_mgr.register_task(module.params['family'], results['taskdefinition'] = task_mgr.register_task(module.params['family'],
module.params['task_role_arn'], module.params['task_role_arn'],
module.params['network_mode'], module.params['network_mode'],