Ansible introduced the lookup plugins in version 0.9. These plugins allow Ansible to fetch data from outside sources. Ansible provides several plugins, but you can also write your own. This really opens the doors and allows you to be flexible in your configuration.
Lookup plugins are written in Python and run on the controlling machine. They are executed in two different ways: direct calls and
with_* keys. Direct calls are useful when you want to use them like you would use variables. Using the
with_* keys is useful when you want to use them as loops. In an earlier section, we covered
with_fileglob, which is an example of this.
In the next example, we use a lookup plugin directly to get the
http_proxy value from