Ansible vars Lists

Lists can be provided to a module through vars  specified inside a Playbook or they can be provided directly inside a Task.

In the examples below we want to send two “show” commands to the devices. The former example uses a vars  list while the latter defines the list inside of the module call:

Both methods work perfectly fine, though the former is more flexible as it can be reused across multiple Tasks.

Knowledge Base

See the Ansible section of my Knowledge Base for more information.

As always, if you have any questions or have a topic that you would like me to discuss, please feel free to post a comment at the bottom of this blog entry, e-mail at, or drop me a message on Twitter (@OzNetNerd).

Note: This website is my personal blog. The opinions expressed in this blog are my own and not those of my employer.