Closed crupib closed 2 years ago
you get this same issue with the docker install. If you are using selinux in either permissive or enforcing mode then you need to install the libselinux-python packages, otherwise set selinux to disabled.
I have libselinux-python installed on the server and in the venv and it still fails.
@crupib What OS is on the target (managed) server? If CentOS7, make sure Ansible is using Python2 as interpreter.
Not sure how to do that. It is CentOS7, but I am not sure where the interpreter would be defined. I don't even think python 2 is installed. Should it be defined in ansible.cfg in /etc/ansible/ Will AWX venv use this?
Not sure how to do that. It is CentOS7, but I am not sure where the interpreter would be defined. I don't even think python 2 is installed. Should it be defined in ansible.cfg in /etc/ansible/ Will AWX venv use this?
On Tue, Jun 23, 2020 at 9:28 PM bluikko notifications@github.com wrote:
@crupib https://github.com/crupib What OS is on the target (managed) server? If CentOS7, make sure Ansible is using Python2 as interpreter.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MrMEEE/awx-build/issues/257#issuecomment-648528379, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5ZHEMYDC3CW3XTS7DDJIDRYFJDPANCNFSM4NQ7OVHQ .
-- bc crupib@gmail.com
The error message target uses selinux but python bindings
talks about a "target". Could you please explain more about the context: for example what are you doing when the error is seen?
If it is seen while running a play then I am familiar with that and might be able to help.
It is an issue in awx, I need to check with the developers in the morning
On Tue, Jun 23, 2020 at 10:02 PM bluikko notifications@github.com wrote:
The error message target uses selinux but python bindings talks about a "target". Could you please explain more about the context: for example what are you doing when the error is seen?
If it is seen while running a play then I am familiar with that and might be able to help.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MrMEEE/awx-build/issues/257#issuecomment-648537344, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5ZHENGRYY33QHLUQ62DJTRYFNETANCNFSM4NQ7OVHQ .
-- bc crupib@gmail.com
So when do you see that error? When running a play?
I will let you know, thanks
On Tue, Jun 23, 2020 at 10:18 PM bluikko notifications@github.com wrote:
So when do you see that error? When running a play?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MrMEEE/awx-build/issues/257#issuecomment-648541582, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5ZHEP3SNPITY4GUTWRBZTRYFPA3ANCNFSM4NQ7OVHQ .
-- bc crupib@gmail.com
FYI: Python 2.7.5 is shipped by default on EL7.
Ansible on python3 and SELinux is a combination that will not work on EL7. You will have to change the Ansible python interpreter to python 2.
Edit: It's not an AWX problem, and moreover, it's even less an AWX-RPM problem.
Edit2: To reply your earlier question, there are many ways to change which interpreter Ansible uses. See https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html - basically you set the var on the level you want to, either when calling ansible-playbook
(not relevant to AWX really), playbook, task, inventory host, ...
Are you by any chance executing the tasks on localhost? They seem to run via Python 3 if you do that. Had the same problem and installing libselinux-python3 didn't fix it.
I recreated the venv with Python 2 using "awx-create-venv -f -p 2", and after that ran "/var/lib/awx/venv/ansible/bin/pip install selinux" to install selinux. Everything works as it should now, doesn't matter if localhost or remote target.
Okay I will try that.
On Mon, Aug 17, 2020 at 6:05 AM Patrick Om notifications@github.com wrote:
Are you by any chance executing the tasks on localhost? They seem to run via Python 3 if you do that. Had the same problem and installing libselinux-python3 didn't fix it.
I recreated the venv with Python 2 using "awx-create-venv -f -p 2", and after that ran "/var/lib/awx/venv/ansible/bin/pip install selinux" to install selinux. Everything works as it should now, doesn't matter if localhost or remote target.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MrMEEE/awx-build/issues/257#issuecomment-674788677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5ZHEKMLC3GVQW46ZKAKTDSBD6E5ANCNFSM4NQ7OVHQ .
-- bc crupib@gmail.com
Project has been updated and moved...
Please move to the new version and report any issues
PROJECT MOVED: https://github.com/miracle-as/AWX-RPM
Issues at: https://github.com/miracle-as/AWX-RPM/issues
**Install guide, tools, utilities are located at: https://awx.wiki
LinkedIn group for Questions, support, talk and more: https://www.linkedin.com/groups/13694893/
"msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"} Works if selinux is disabled.