how to use included variable from file with jinja2 template and with_items

I am having an error where the fields of my variable are not being detected when trying to build a configuration using a jinja2 template. This is to sync Linux repositories to yum and apt based systems from a golden source using ansible. Each repository configuration would go into a different file and the task updated with the variable name. Base system configs should be able to be put in one file using multiple uses of "-" then a list of attributes.

I have reviewed:

for loop in jinja2omarkhawaja.com/accessing-ansible-variables-with-jinja2-loopsstackoverflow.com/questions/25418158/te...epo-files-with-ansible-template-module

as well as others that are less relevant to what I am doing.

var file:

include var task:

task to use template module:

template:

error:

whichever attribute in role is first called by the jinja2 template will fail in this way. If I change the following so name isn't referenced and "i.name" becomes just "chrome" it will fail on async

I can see the variable is imported

I do see it says "unicode" variable where I would expect it to be a dict. I have also tried with_dict and the error says that the variable is not a dictionary. However if I structure the variable file without "repo:", it will error saying it was not passed a dictionary object...

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论