mitogen base module¶
This module isn’t an adapter, it serves as a base for many other modules which need to interact with remote hosts. It uses the mitogen
library to easily setup a python environment on any remote host and execute the requested code on them.
Environment variables¶
The behavior of the module can be influenced by setting some environment variables.
Env var name |
Default value |
Description |
---|---|---|
|
|
When executing any function on a remote host, the mitogen |
|
|
If a logged value is truncated because it is too long to be logged completely (cf. |
Exceptions¶
inmanta_plugins.mitogen.PythonNotFoundError
: This exception is raised when the python interpreter provided to mitogen can not be found on the host where mitogen is instantiating a context. The path of this python interpreter can be provided in two ways:If you are constructing the
mitogen::Context
entities in the model, you can change the value of thepython_path
attribute of your entity to match a python path that exists on the host.If you are using the implicit context that comes with the
std::Host
entity (that the resource attaches itself to using thehost
relation), then you can update thepython_cmd
attribute of thestd::OS
entity attached to that host, as it will be what determines the python path.
Knowing which python path to use is not always straightforward. The mitogen module always expects a python3.9+ binary, which on most linux distributions can be found using
python3
as a python path. Here is a list of distributions which will require you to use a different path:Distro
Path
RHEL/Rocky/Alma 8
/usr/libexec/platform-python