A tool and python library that helps when interfacing with Ansible directly or as part of another system whether that be through a container image interface, as a standalone tool, or as a Python module that can be imported. The goal is to provide a stable and consistent interface abstraction to Ansible.
Other
968
stars
356
forks
source link
get_inventory does not support running in different venv #1287
get_inventory function (like others) accepts envvars argument. With this I want to switch to different python venv (same as doing when using run function).
e.g.
In set_environment i am setting VIRTUAL_ENV and PATH to venv where ansible is installed.
But in InventoryConfig.init() code is checking for ansible-inventory binary in primary env (where runner is installed) and ignores my envvars. (self._ansible_inventory_exec_path = get_executable_path("ansible-inventory"))
I would like to be able to run all ansible related commands (including ansible-inventory) in custom/specific venv.
I don't believe this is a first-class functionality we want to support, at least at this time. It gets especially complicated when considering running in a containerized environment.
get_inventory
function (like others) acceptsenvvars
argument. With this I want to switch to different python venv (same as doing when using run function). e.g.In
set_environment
i am setting VIRTUAL_ENV and PATH to venv where ansible is installed.But in
InventoryConfig.init()
code is checking foransible-inventory
binary in primary env (where runner is installed) and ignores my envvars. (self._ansible_inventory_exec_path = get_executable_path("ansible-inventory"))I would like to be able to run all ansible related commands (including ansible-inventory) in custom/specific venv.