Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitize parameters when comparing with existing ecs_taskdefinition #281

Closed

Conversation

nikhilo
Copy link

@nikhilo nikhilo commented Oct 27, 2020

SUMMARY

Addresses issues with idempotence for ecs_taskdefinition module

  • If certain parameters are templatized, they will have different data types in the existing task definition as compared to the requested values.
    e.g. cpu: "{{ nginx.cpu }}" will appear as cpu: "1111" (string) in the module invocation. And when you invoke this the second time, the module fails to detect that the CPU value is actually the same. And registers a new task definition.
  • Certain (non essential) parameters can be omitted from the module invocation. But on the second invocation when we compare the module parameters with existing task_definition(s), these parameters appear in the comparison and fail a potential match.
    e.g. Key essential in containers. Key protocol in containers[].portMapping
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ecs_taskdefinition

ADDITIONAL INFORMATION

Unfortunately the module output does not indicate why it's registering a new task definition. Hence command output might not be very useful.


@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug community_review module module needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging labels Nov 16, 2020
@alinabuzachis
Copy link
Contributor

Hi @nikhilo, thank you for your contribution. May you kindly add a changelog fragment https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs and a functional test? If you need any help, feel free to reach out on IRC #ansible-aws.

@markuman
Copy link
Member

Hm, I don't know how, but some of the changed lines from this PR are already in the main branch.
Furthermore @alinabuzachis made a lot of in this direction with PR #574
I think we can close this for now.
Feel free to re-open this PR if necessary or contribute more features and bug fixes.

@markuman markuman closed this Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 bug This issue/PR relates to a bug community_review module module needs_changelog needs_tests new_contributor Help guide this first time contributor plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants