Winning at Ansible: How to manipulate items in a list!
Reading Time: Approximately 3 minutes.
The Problem
Ansible is a great configuration management platform with a very, very extensible language for expressing yoru infrastructure as code. It works really well for common workflows (deploying files, adding authorized_keys, creating new EC2 instances, etc), but its limitations become readily apparent as you begin embarking in more custom and complex plays.
Here’s a quick example. Let’s say you have a playbook that uses a variable (or var in Ansible-speak) that contains a list of tables, like this:
![[]](https://media.licdn.com/mpr/mpr/shrinknp_800_800/AAEAAQAAAAAAAALDAAAAJGQ0YjI0MTcwLWVmZmMtNDNmZi1iODBmLWQ1MTNmNjUxNDE4Zg.jpg)
