From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Exploring lookup plugins

Exploring lookup plugins

In this video we'll talk about lookup plugins. Lookup plugins are created to use data from external sources, like files and environment variables. It helps you for instance if you want to include, host, set environment variables in your Ansible playbook. There are many lookup plugins available, and you can use ansible-doc-t-lookup-l for a complete And use Ansible doc-tlookup for the plugin name for documentation of a specific plugin. Alternatively, you can also use the documentation that is available at docs.ansible.com. Now, lookup plugins can be called in two different ways, lookup and query. Lookup is what you use to read file content into a variable. And query is what you use to read the file content into the variable where the file content is stored as a list. list. So that's a small difference, but it's important anyway. There's a couple of useful lookup plugins available. FAL to start with reads the contents of FAL from the control node. TEMPLATE processes the contents of a…

Contents