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