I have many ini format config files, below is template

[DEFAULT] 
bbb=bbbbb

[CONNECTION] 
ddd=ddddd


I have below ansible playbooks segment


name: Setup ini config file 
ini_file: dest=/etc/test.conf section={{ item.0 }} option={{ item.1 }} 
value={{ item.2 }} 
with_nested: 
-- ['DEFAULT], 'aaa', 'aaaaaa' ] 
-- ['CONNECTION', 'ccc', 'ccccccccccc' ]


But after running, the final files are not my expectation.


I want my file to be 
[DEFAULT] 
bbb=bbbbb 
aaa=aaaaaa


[CONNECTION] 
ddd=ddddd 
ccc=ccccccc


Could anyone tell me how to do?

Thanks in advance!

BTW, seemed with_items also not work.

My ansible is 2.0.1.0 and running on CentOS 7


BRs/Xu Gang

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/76af6adb-4107-44fb-90d4-f415a5c8b110%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to