-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup module fails with AttributeError: 'module' object has no attribute 'selinux_getpolicytype' in get_selinux_facts on Fedora Stream 8 #10517
Comments
I have the same problem with oracle linux 8.8 and python 3.11 : TASK [kubernetes/preinstall : Set selinux policy] ******************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: module 'selinux' has no attribute 'selinux_getpolicytype'
fatal: [redacted]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"<stdin>\", line 107, in <module>\n File \"<stdin>\", line 99, in _ansiballz_main\n File \"<stdin>\", line 47, in invoke_module\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_ansible.posix.selinux_payload_vv6y9kx6/ansible_ansible.posix.selinux_payload.zip/ansible_collections/ansible/posix/plugins/modules/selinux.py\", line 347, in <module>\n File \"/tmp/ansible_ansible.posix.selinux_payload_vv6y9kx6/ansible_ansible.posix.selinux_payload.zip/ansible_collections/ansible/posix/plugins/modules/selinux.py\", line 249, in main\nAttributeError: module 'selinux' has no attribute 'selinux_getpolicytype'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} |
i have the same error on oracle linux 8 and python 3.11 can't use default python-3.6 because it's too old (actually pip3 from python 3.6 branch is too old, complaining about upgrade) and you can't install ansible or cryptography module with 3.6 python... and i have to take
rpm rebuild:
and only after that ansible selinux linux problem vanished. And I suggest to reinstall/restore original python3-libselinux package (linked to python 3.6) after k8s installation. PS: or don't use oracle linux as a host on which you run kubespray, use some other linux distribution, like ubuntu 22.04, which does not have multiple python versions. PS2: does it makes sense to patch kubespray to skip selinux setup on oracle linux 8 hosts? |
Upstream issue (look like) : ansible-collections/ansible.posix#502
I would lean towards no, but maybe others have a different opinions... |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
QUICK FIX / HOT FIX FOR LAZY PEOPLE LIKE ME ))
|
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Environment:
Cloud provider or hardware configuration:
python3.11
OS (
printf "$(uname -srm)\n$(cat /etc/os-release)\n"
):NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream
Version of Ansible (
ansible --version
):Version of Python (
python --version
):python3.11
Kubespray version (commit) (
git rev-parse --short HEAD
):Network plugin used:
calico
Full inventory with variables (
ansible -i inventory/sample/inventory.ini all -m debug -a "var=hostvars[inventory_hostname]"
):Command used to invoke ansible:
Output of ansible run:
Anything else do we need to know:
The text was updated successfully, but these errors were encountered: