-
Notifications
You must be signed in to change notification settings - Fork 398
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
cloudwatchevent_rule: module breaks when trying to put Jinja2 variables to "input" parameter #201
Comments
I would like to add that we are also finding this error with version 2.9.6. We either get the error above or if you force it to a string, you get the error.
|
CC: @jsdalton (module author) Hi @fayaaz, thank you for taking the time to raise this issue. Where I've seen this before it's been a result of the argument parser trying to be clever and converting this in the background. The fix is likely to be explicitly defining the 'suboptions' for the "targets" argument so that input can be explicitly defined as a type 'json'. Unfortunately I don't have much experience with the cloudwatchevent_rule module so were I to start digging into this it may take a while. Mark |
Hi @fayaaz, did you find any workaround for this? |
…e-collections#201) * support nested secrets for secrets lookup plugin and test coverage * pep8 and pylint fixes
cloudwatchevent_rule - Add argspec validation for targets SUMMARY fixes: #201 Targets currently has minimal validation applied. Because of the way Ansible converts JSON strings to dicts/lists, then back to the Python format string representing the dicts/lists, unless we explicitly define a parameter is a JSON string they get corrupted. This also moves the new input_paths_map/input_template parameters under input_transformer. Because we've not released 4.1.0 yet this doesn't cause any breakage. This will make adding other target parameters simpler further down the road. (There's a lot that we don't support today) ISSUE TYPE Bugfix Pull Request COMPONENT NAME cloudwatchevent_rule ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis <None>
cloudwatchevent_rule - Add argspec validation for targets SUMMARY fixes: #201 Targets currently has minimal validation applied. Because of the way Ansible converts JSON strings to dicts/lists, then back to the Python format string representing the dicts/lists, unless we explicitly define a parameter is a JSON string they get corrupted. This also moves the new input_paths_map/input_template parameters under input_transformer. Because we've not released 4.1.0 yet this doesn't cause any breakage. This will make adding other target parameters simpler further down the road. (There's a lot that we don't support today) ISSUE TYPE Bugfix Pull Request COMPONENT NAME cloudwatchevent_rule ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis <None> (cherry picked from commit 5f0e10e)
[PR #1355/5f0e10e7 backport][stable-4] cloudwatchevent_rule - Add argspec validation for targets This is a backport of PR #1355 as merged into main (5f0e10e). SUMMARY fixes: #201 Targets currently has minimal validation applied. Because of the way Ansible converts JSON strings to dicts/lists, then back to the Python format string representing the dicts/lists, unless we explicitly define a parameter is a JSON string they get corrupted. This also moves the new input_paths_map/input_template parameters under input_transformer. Because we've not released 4.1.0 yet this doesn't cause any breakage. This will make adding other target parameters simpler further down the road. (There's a lot that we don't support today) ISSUE TYPE Bugfix Pull Request COMPONENT NAME cloudwatchevent_rule ADDITIONAL INFORMATION Reviewed-by: Mark Chappell <None>
cloudwatchevent_rule - Add argspec validation for targets SUMMARY fixes: ansible-collections#201 Targets currently has minimal validation applied. Because of the way Ansible converts JSON strings to dicts/lists, then back to the Python format string representing the dicts/lists, unless we explicitly define a parameter is a JSON string they get corrupted. This also moves the new input_paths_map/input_template parameters under input_transformer. Because we've not released 4.1.0 yet this doesn't cause any breakage. This will make adding other target parameters simpler further down the road. (There's a lot that we don't support today) ISSUE TYPE Bugfix Pull Request COMPONENT NAME cloudwatchevent_rule ADDITIONAL INFORMATION Reviewed-by: Alina Buzachis <None> This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections@5f0e10e
Copied from here:
ansible/ansible#35224
SUMMARY
ISSUE TYPE
COMPONENT NAME
cloudwatchevent_rule
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Template file base.yml
Execution playbook tasks.yml
This is how I run this playbook.
Probably, can't be fully reproduced, because you have to make your own ECS cluster, task definition and so on.
To make it work without errors - just append the variables file and task directly to the base.yml and run it.
EXPECTED RESULTS
Ansible will create a new Cloudwatch event rule as a ECS scheduled task.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: