The PAM Ansible package includes Python code with two main entry points:
Name | Script | Notes |
---|---|---|
pamapi | python/pamapi.py | Commands that make calls to the PAM API. |
pamtool | python/pamtool.py | Various PAM automation and utility commands. |
These tools may be run from the PAM Ansible package as follows:
python3 -m venv .venv . .venv/bin/activate pip install -r requirements.txt python python/pamapi.py python python/pamtool.py
Some Ansible PAM playbooks call the python tools on the local Ansible controller when setting up a new PAM farm. The playbooks and roles should be set up so this works automatically with no extra setup.
Some Ansible PAM playbooks need to run the python tools on the remote host. This is how it works:
PyInstaller
module to compile the Python scripts into portable
executable programs named pamapi
and pamtool
.
/usr/local/bin/
on the remote host.
/usr/local/bin/pamapi
(or pamtool
) can be run as
a native program without requiring Python to be installed or a Python environment to be set up.