produces:
`
ERROR! Syntax Error while loading YAML.
found unacceptable key (unhashable type: ‘AnsibleMapping’)
The offending line appears to be:
HostName: “+”
Port: {{ range(43000,43200) | list }}
^ here
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
{{ foo }}
Should be written as:
with_items:
“{{ foo }}”
`
So I removed the interpolation:
Port: range(43000,43200) | list
which produces:
fatal: [dev21-sfapp12]: FAILED! => {"changed": false, "module_version": "1.0.1", "msg": "Convert property 'Port' value from type 'STRING[]' to type 'SINT32[]' failed\r\n At line:11, char:2\r\n Buffer:\r\n Protocol = \"http\";\n};^\n\ninsta\r\n", "reboot_required": false}
No you are not, the jinja2 block is evaluated before it’s passed to the module so the data will contain the array you are looking for. Did you try it out?