Replies: 2 comments
-
To be honest this error comes from the module itself and looks related to https://www.reddit.com/r/ansible/comments/y9v5rf/help_with_error_dictionary_requested_could_not/ Using the debugger I got a little bit more info about the error:
Still, i will have to move this to a discussion until we have a prove there is a bug in the linter itself. I will raise the bug myself once we have confirmation. |
Beta Was this translation helpful? Give feedback.
-
The difference is that the person in the reddit thread you linked really did format the module arguments wrong and so their task didn't even run. But this task runs perfectly and all of the expected data/arguments are supplied correctly. It is only ansible-lint that can't see that. This: [ {% for item in _usable_wan_interfaces %} { 'interface_name': 'VPN-{{ item.name }}' }, {% endfor %} ] will expand to: - interface_name: VPN-wan1
- interface_name: VPN-wan2 which is exactly the data format the module expects for the https://ansible-galaxy-fortios-docs.readthedocs.io/en/latest/gen/fortios_system_zone.html#parameters |
Beta Was this translation helpful? Give feedback.
-
Summary
The new args[module] rule reports errors if you use a Jinja template for a module parameter.
Issue Type
OS / ENVIRONMENT
ansible-lint 6.10.0 using ansible 2.14.1
STEPS TO REPRODUCE
Create the following directory structure:
with the
task.yml
file content:and run
ansible-lint
.Desired Behavior
Ideally it would just pass, but according to #2833 and the docs warnings may be expected due to known limitations.
Actual Behavior
ansible-lint reports a FATAL error "dictionary requested, could not parse JSON or key=value":
Beta Was this translation helpful? Give feedback.
All reactions