I made some slight progress, but haven't figured out how to get this to work entirely in my py3venv.
With some troubleshooting, I noticed the following: setup is reporting that selinux is present.
(py3venv) [user@lab playbooks]$ ansible -m setup -i rawhide.vgr, all | grep selinux
"ansible_selinux": {
"ansible_selinux_python_present": true,
(py3venv) [user@lab playbooks]$ which ansible
~/py3venv/bin/ansible
But when I try to ensure that my python interpreter is the one from my virtual py3venv environment, I recieve present: false. I tried this for
(py3venv) [user@lab playbooks]$ ansible -e 'ansible_python_interpreter=~/py3venv/bin/python3' -m setup -i rawhide.vgr, all | grep selinux
"ansible_selinux": {
"status": "Missing selinux Python library"
"ansible_selinux_python_present": false,
I tried these following as parameters for the
ansible_python_interpreter. Here are the responses.
False /usr/bin/python
False /usr/bin/python3
False ~/py3venv/bin/python
False ~/py3venv/bin/python3
True /usr/libexec/platform-python
So, if i run my original command with the final ansible interpreter, it works.
ansible-playbook -e 'ansible_python_interpreter=/usr/libexec/platform-python' playbook.yml
How can I get my python3 virtual environment to work like I want it to?