Looks like no one has responded with any suggestion / solution for python 
2.7.x

I would like to repost incase this is ignored.

On Friday, August 9, 2019 at 3:51:21 PM UTC+5:30, Mohtashim S wrote:
>
> The servers are on python 2.7.5
>
> I can't use python 3, btw would like to know the solution for python 3 
> along with a solution for python 2.7.5 ?? 
>
> On Friday, August 9, 2019 at 12:24:27 PM UTC+5:30, Mohtashim S wrote:
>>
>> My requirement is pretty straight forward. 
>>
>> I wish to pass & read a set of string as array from ansible which is 
>> constructed by iterating over using with_items as show below.
>>
>>    - name: set_fact
>>      set_fact:
>>        fpath: [] 
>>      set_fact:
>>        fpath: "{{ fpath + [ BASEPATH ~ '/' ~ vars[item.split('.')[1]] ~ 
>> '/' ~ item | basename ] }}"
>>      with_items:
>>       - "{{ Source_Files.split(',') }}"
>>      vars:
>>       fpath: []
>>
>> Using the set_fact module i collect the strings in a array variable 
>> called 'fpath' and then pass the variable to a shell script using shell 
>> module as below. 
>>
>>    - shell: " ~/backup.sh '{{ fpath }}' "
>>
>> The challenge is that the passed string array fpath is unicode and is 
>> read as below in the shell script: 
>>
>> [u/tmp/file.js, u/var/test.txt, u/tmp/llo.rft]
>>
>> Parsing this in unix shell script becomes challenging as evident by my 
>> post to this forum 
>> <https://www.unix.com/shell-programming-and-scripting/282469-unable-print-python-array-shell-script-loop.html>
>>  and 
>> I'm looking for a better solution to my requirement. 
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c8f7fbee-15a8-4e1c-96e7-7675f318e4e2%40googlegroups.com.

Reply via email to