I'm trying to make use of Ansible for configuration management and centralized administration.
All the machines I'm interested about are actually containers on the host which is going to run Ansible.
Currently I am writing a dynamic inventory script that groups the different hosts and makes certain hostvars available per group and also per host.
How can I use the inventory information to run local tasks?
Example: I have a container named foo
and the dynamic inventory defines certain items like IP address, cgroup limits and so on for it. How can I reuse that information before the guest container is even up, in order to generate (using the usual Jinja2 templates) the container configuration on the host?