title: Ansible/Jinja2 error: no filter named 'map'
body: <p>Running an Ansible playbook on a centos7 server. site.yml includes the following:</p>
  
  <pre><code>elastic_cluster_ips: "{{ groups['es_cluster'] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | list}}"
  </code></pre>
  
  <p>but I keep getting this error:</p>
  
  <pre><code>FAILED! =&gt; {"changed": false, "msg": "AnsibleError: An unhandled exception occurred while templating '{{ groups['es_cluster'] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | list}}'. Error was a &lt;class 'ansible.errors.AnsibleError'&gt;, original message: template error while templating string: no filter named 'map'. String: {{ groups['es_cluster'] | map('extract', hostvars, ['ansible_default_ipv4', 'address']) | list}}"}
  </code></pre>
  
  <p>Preliminary searching looked like it might be a jinja2 version issue with earlier versions not having the map filter. I've checked my version though and it seems to be up to date. Any ideas what I'm doing wrong here?</p>
  
  <p>Versions:
  ansible 2.6.7, 
  python 2.6.6,
  jinja2 2.10</p>
  
  <p>Thanks!</p>