I am trying to grab every other character in a very long variable, and
placing it in another variable. This is what I have:
set_fact:
new_string: "{{ [ 0,2,4,6,8,10,12 ] | map('extract', verylongvariable)
}}"
I've also tried this:
set_fact:
new_string: "{{ [ 0,2,4,6,8,10,12 ] | map('extract', verylongvariable)
}} | map('join', ',' | join('')) }}
What I end up getting in the new_string is this:
'N', 'y', 'a', 'd'....
What I want is:
Nyad....
I clearly am not understanding the join syntax. How do I use join to get
the new variable?
--
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/ec75223e-8d4a-4aa8-bbfa-2d78389d35fan%40googlegroups.com.