Hey,
You are very the best !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! it's works !!!
Thank you veryyyyy muchhhhhh !!!! I love you !!!! =)
Regards,
Le mercredi 21 août 2019 18:29:21 UTC+2, Vladimir Botka a écrit :
>
> Hi, add the items to the list in the loop
>
> - set_fact:
> indice: "{{ indice|default([]) + [item.split(',')[0]] }}"
> ...
>
> -vlado
>
>
> On Wed, 21 Aug 2019 08:36:58 -0700 (PDT)
> Karther <[email protected] <javascript:>> wrote:
>
> > Hey,
> >
> > I have on file csv "clef_applicatives.csv" with this content :
> >
> > 13,my_user,my_host,gis
> > 14,my_user,my_host,gis
> >
> >
> > I have next tasks with this content :
> >
> > - set_fact:
> > indice: "{{ item.split(',')[0] }}"
> > with_lines: cat
> /home/ansible/test/test_ssh_manager/clef_applicatives.csv
> > when: item.split(',')[2] == inventory_hostname
> > delegate_to: localhost
> >
> > - name: "Afficher indice"
> > debug:
> > msg: "{{ indice }}"
> >
> > The problem is that my variable indice get only last indice of my file
> who
> > is 14 and not 13.
> >
> > How do for that ansible play playbook with this both values.
> > (there is probabily other values in this file ...)
> >
> > Help me please community ansible !!!!
> >
> > Regards,
> >
> > Karther
> >
>
>
>
>
> --
> Regards,
> Vladimir
>
> Vladimir Botka
> [email protected] <javascript:>
> +420.773.041.182
> Smeralova 13, Prague 17000, Czech
> https://www.botka.link/
> https://www.linkedin.com/in/vbotka/
> --
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0cce0bc5-f1d5-40da-bbd9-42d844c5ca45%40googlegroups.com.