You just need a join to make your current expression's output (list)
into a string.
But @sivel's solution with slicing is probably better, the reason you
cannot find it in documentation is because this is a "Pythonism" and a
property of Python list objects.
Ansible uses Jinja for expression evaluation, Jinja compiles into
Python in the end and exposes many of the properties of those Python
objects, neither Ansible nor Jinja document these properties so you
would need to a) know the type of object you are dealing with and b)
look at python documentation for those objects.
What are some good resources to learn Ansible "pythonism" filters? I struggle with string manipulation, sets, dict merging, etc. In my opinion this is one of the greatest strengths of Ansible.
How did you guys learn it? Did you learn it because you knew python first?