my inventory file is like below with more additional group_vars and host_vars that I havent mentioned here for simplicity:
I dont want to use host_vars as of now.
[qa]
host1 var1=‘[“hi” , “xy”]’ var2=[435345, 3425634]
host1 var2=‘[“asd” , “er”]’ var2=[212, 456]
host1 var3=‘[“zxc” , “ghhj”]’ var2=[567, 80]
host1 var4=‘[“hi” , “hhj”]’ var2=[435, 980]
Im trying to create a yml file out of this via jinja2
{{% for host in groups[‘qa’] %}}
host: {{ host }}
params:
{{% for i,j in zip(var1,var2) %}} → Im not sure how to achieve something like this in jinja2. Can someone please guide?
app: {{ i }
port: {{ j }}