Home Extracting all named values from an ansible array
 I'm not even quite sure how to describe what I'm trying to do! So I'll just jump straight in. I have a hosts file : [jvbservers] jvb0 ansible_host=serverA jvb1 ansible_host=serverB  etc... And I want a list of the servers in the jvbservers group. What I've come up with so far feels a bit OTT.  set_fact: jvb_names: "{{ jvb_names|default([]) + [ hostvars[groups.jvbservers[item|int]].ansible_host ] }}" with_sequence: start=0 end="{{groups.jvbservers|length-1}}"  Gives me a result like I want : ok: [localhost] => { "jvb_names": [ "serverA", "serverB" ] }  Is this sensible? It feels like there should be a neater way to do something like : hostvars[groups.jvbservers[*]].ansible_host  (Where "*" would be a pattern matching all valid options. Obvs that particular syntax doesn't exist!)