Ansible Role python_venv
This role creates and manages various Python 3 virtual environments (venv). These are placed below /opt/python-venv/ on the target system.
Mandatory Requirements
Install Python 3
On Rocky 9, the CRB Repo („Code Ready Builder“) needs to be enabled to be able to deploy
python3-virtualenv- otherwise you’ll getnothing provides python3-wheel-wheel needed by python3-virtualenv-20.21.1-1.el9.noarch from epel.
Optional Role Variables
Variable  | 
Description  | 
Default Value  | 
|---|---|---|
  | 
Path to PEM-encoded CA certificate bundle. Set this to use the system CA store instead of pip’s built-in certficates. See ‚SSL Certificate Verification‘ in pip documentation for more information.  | 
unset  | 
  | 
Dictionary containing definitions for the virtual environments. Subkeys: 
 For the usage in host_vars / group_vars (can only be used in one group at a time). | 
  | 
Example:
# optional
python_venv__pip_cert: '/etc/pki/tls/certs/ca-bundle.crt' # system CA bundle on RHEL 8
python_venv__venvs__host_var:
  - name: 'clamav-fangfrisch'
    packages:
      - 'fangfrisch'
    exposed_binaries:
      - 'fangfrisch'
    package_requirements:
      - 'python39'
      - 'python39-devel'
    python_executable: 'python3.9'
  - name: 'duplicity'
    packages:
      - 'duplicity'
      - 'python-swiftclient'
      - 'python-keystoneclient'
    package_requirements:
      - 'gcc'
      - 'librsync-devel'
    exposed_binaries:
      - 'duplicity'
python_venv__venvs__group_var: []