anchor.diff:  ----
   include::{source_dir}/group_vars/all.yml[tags=map_advanced]
   ----
  -<1> For each `users` take its name and when the regular expression matches , apply the replacement, then join the result.
  +<1> For each `users` take its name and when the regular expression matches  apply the replacement, then join the result.
   
   == JSON Query
   
   Another strategy is to use a JSON Path to walk down the YAML tree.
  +It's bit less verbose and bit more powerful than the previous solution.
   
   ----
   include::{source_dir}/group_vars/all.yml[tags=json_query]
  
positive.code: 
  As a Java developer, I sometimes dream that I can use the Java 8+ Stream API in my Ansible playbook to process list and dict variables.
  
  [source,yaml]
  ----
  include::{source_dir}/group_vars/all.yml[tags=list_var]
  
negative.code: <1> Take the `id` attributes of `users` having `admin` set to true and then join them.
  <2> Take the `id` attributes of `users` having `role` set to `assistant` and then join them.
  
  This `json_query` is based on the `jmespath` Python https://pypi.org/project/jmespath/[library], this means 2 things:
  
  . You can use http://jmespath.org/[jmespath.org] web site to cook your JSON path query.
  . You'll have to add the `jmespath` library to your Python environnement.
  
  Sadly, nesting JMESPath expressions inside Jinja template expressions inside YAML files can be tricky.
  This following example fails, even if the JMES path is alright in Python interpreter.
  ----
  include::{source_dir}/group_vars/all.yml[tags=json_query_error]
  ----
  
  == Conclusion
  
  It's possible to transform a variable containing an array into another list. However it's still painful to do.
  
  