[ansible-project] Re: need help to configure a loop

2021-06-28 Thread david...@mycit.ie
Hi, Have you tried using the Block function of Ansible? https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html https://ericsysmin.com/2019/06/20/how-to-loop-blocks-of-code-in-ansible/ On Monday, June 28, 2021 at 11:14:40 AM UTC+1 yahi...@gmail.com wrote: > Hello guys, > I ne

Re: [ansible-project] Re: need help to configure a loop

2021-06-28 Thread Yahia CHILALI
Thx David, Ansible is very new for me... :) I didn't see block stuff. I'm going to try! Le lun. 28 juin 2021 à 12:56, david...@mycit.ie a écrit : > Hi, > > Have you tried using the Block function of Ansible? > > https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html > > https:/

Re: [ansible-project] Re: need help to configure a loop

2021-06-28 Thread Yahia CHILALI
Hi again, I can't feed the correct syntax... i tried with with_lines: cat /etc/ansible/group_vars/afyahia or loop: cat /etc/ansible/group_vars/afyahia Do you know the good attribute? ERROR! 'loop' is not a valid attribute for a Block ERROR! 'with_lines' is not a valid attribute for a Block Le lun.

Re: [ansible-project] Re: need help to configure a loop

2021-06-28 Thread Roberto J. R. Paz
You can't apply a loop to a block. A possible caveat for that is to include the code of the block as a separated playbook and run the loop on that. Example here: https://ericsysmin.com/2019/06/20/how-to-loop-blocks-of-code-in-ansible/ El lun, 28 jun 2021 a las 9:53, Yahia CHILALI () escribió: >