Hi again. Sorry if I am spamming.

I tried with below 2 option it is passing the argument as expected. I
changed from double quotes to single quote now it is working.
*{{ ansible_play_hosts_all | join('  ') }}*
*{{ groups['all'] | join(' ') }}*

*Thank you so much again*

On Wed, Jun 21, 2023 at 11:53 PM Prady A <[email protected]> wrote:

> Thank you both for your kind help.
> my python script expects a list. I am expecting something like  below list
> data= [["1ld501"], ["1ld994"]]
>
> This is working for me when I hardcoded inside python script. I am
> expecting similar list from ansible script.
> with the above join command all the hostname concatenates to one string
> which I am not anticipating. Kindly help.
>
> Regards
>
>
> On Wed, Jun 21, 2023 at 11:35 PM Brian Coca <[email protected]> wrote:
>
>> The difference between a 'python list' ( [item, item2] ) and a 'shell
>> list' `item item2`, as @Dick Visser shows a simple join can translate
>> one to the other.
>>
>> --
>> ----------
>> Brian Coca
>>
>> --
>> 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/CACVha7fKhVM-0ym6fMnCgMex74kdnim6xa34jbiLC9tz1UrYaA%40mail.gmail.com
>> .
>>
>

-- 
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/CAEuB3Aq7Fu_95EiZ-Y9AhUWSQX%3DJh9w_NRVJvnsZZv_OWOt8NQ%40mail.gmail.com.

Reply via email to