Sagan
(Sagan)
September 10, 2022, 4:44pm
1
IF you have your closters has dicts in your variable you can use a loop with dict2items and loop around it, as to writing it in your file you can use this module
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html
racke
(Stefan Hornburg)
September 10, 2022, 4:49pm
2
IF you have your closters has dicts in your variable you can use a loop with dict2items and loop around it, as to writing it in your file you can use this module
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html
Using lineinfile doesn't make sense when your write the whole file. In this case the template module is the better choice.
Regards
Racke