I need to create list of dicts using only jinja2 from an array input.
One key/value pair is static and always the same, the other changes value.
Input:
targets: ["abc", "qwe", "def"]
I know that the server will always be xyz.
Final
connections:
- { "target": "abc", "server": "xyz" }
- { "target": "qwe", "server": "xyz" }
- { "target": "def", "server": "xyz" }
I tried this:
"{{ dict(targets | zip_longest([], fillvalue='xyz')) }}"
But that just takes one for key and the other for value.