I've been looking around for a while for the same thing for action plugins.
As I've not been able to find the answer, here is what I came for.
Within the ActionModule class, you can get an inventory with :
inventory = InventoryManager(self._loader, C.DEFAULT_HOST_LIST)
To access to the host variables, you can do :
inventory.get_host(self._connection.host).vars
You also need these imports :
from ansible.inventory.manager import InventoryManager
from ansible import constants as C
Hope this will help someone as I've been searching this for a while !!!
--
You received this message because you are subscribed to the Google Groups
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.