Adding strings to an array in Ansible | Jeff Geerling
www.jeffgeerling.com › blog › 2017Jun 16, 2017 · From time to time, I need to dynamically build a list of strings (or a list of other things) using Ansible's set_fact module. Since set_fact is a module like any other, you can use a with_items loop to loop over an existing list, and pull out a value from that list to add to another list. For example, today I needed to retrieve a list of all the AWS EC2 security groups in a region, then loop through them, building a list of all the security group names.