admin管理员组文章数量:1410674
I am trying to do a multinode deployment of kolla-ansible on two of my DL360p's. Everything seems setup well, but when I run the bootstrap I get the following
The full traceback is:
Traceback (most recent call last):
File "/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py", line 107, in <module>
_ansiballz_main()
File "/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.ansible.posix.plugins.modules.selinux',
init_globals=dict(_module_fqn='ansible_collections.ansible.posix.plugins.modules.selinux',
_modlib_path=modlib_path),
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ansi
ble/posix/plugins/modules/selinux.py", line 351, in <module>
File "/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ansi
ble/posix/plugins/modules/selinux.py", line 253, in main
AttributeError: module 'selinux' has no attribute 'selinux_getpolicytype'
fatal: [cirrus-openstack-1]: FAILED! => {
"changed": false,
"module_stderr": "OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024\r\ndebug1: Reading
configuration data /etc/ssh/ssh_config\r\ndebug3: /etc/ssh/ssh_config line 55: Including
file /etc/ssh/ssh_config.d/50-redhat.conf depth 0\r\ndebug1: Reading configuration data
/etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2: checking match for 'final all' host
192.168.10.8 originally 192.168.10.8\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line
3: not matched 'final'\r\ndebug2: match not found\r\ndebug3: /etc/ssh/ssh_config.d/50-
redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1
(parse only)\r\ndebug1: Reading configuration data /etc/crypto-policies/back-
ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-
sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names ok: [curve25519-
sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-
nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-
group16-sha512,diffie-hellman-group18-sha512]\r\ndebug1: configuration requests final Match
pass\r\ndebug2: resolve_canonicalize: hostname 192.168.10.8 is address\r\ndebug1: re-
parsing configuration\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug3:
/etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth
0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2:
checking match for 'final all' host 192.168.10.8 originally 192.168.10.8\r\ndebug3:
/etc/ssh/ssh_config.d/50-redhat.conf line 3: matched 'final'\r\ndebug2: match
found\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-
policies/back-ends/openssh.config depth 1\r\ndebug1: Reading configuration data
/etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-
sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names
ok: [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-
nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-
sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512]\r\ndebug3: expanded
UserKnownHostsFile '~/.ssh/known_hosts' -> '/root/.ssh/known_hosts'\r\ndebug3: expanded
UserKnownHostsFile '~/.ssh/known_hosts2' -> '/root/.ssh/known_hosts2'\r\ndebug1: auto-mux:
Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2:
mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request
forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3:
mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid =
152168\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1:
mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read
header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared
connection to 192.168.10.8 closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File
\"/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py\", line 107, in <module>\r\n _ansiballz_main()\r\n
File \"/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py\", line 99, in _ansiballz_main\r\n
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File
\"/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py\", line 47, in invoke_module\r\n
runpy.run_module(mod_name='ansible_collections.ansible.posix.plugins.modules.selinux',
init_globals=dict(_module_fqn='ansible_collections.ansible.posix.plugins.modules.selinux',
_modlib_path=modlib_path),\r\n File \"<frozen runpy>\", line 226, in run_module\r\n File
\"<frozen runpy>\", line 98, in _run_module_code\r\n File \"<frozen runpy>\", line 88, in
_run_code\r\n File
\"/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ans
ible/posix/plugins/modules/selinux.py\", line 351, in <module>\r\n File
\"/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ans
ible/posix/plugins/modules/selinux.py\", line 253, in main\r\nAttributeError: module
'selinux' has no attribute 'selinux_getpolicytype'\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
I am prepping the environments with an ansible playbook which installs the following
- name: Ensure required packages are installed
dnf:
name:
- epel-release
- python3.12
- python3.12-devel
- python3.12-pip
- python3-virtualenv
- python3-libselinux
- libselinux-python3
- git
- net-tools
- libffi-devel
- dbus-devel
- openssl-devel
- glib2-devel
- gcc
state: present
I have tried with Python 3.12 and 3.9 with the same result. Would anyone be able to point me in the right direction please? I've lost a day on this and am very excited to get my homelab up and running.
And I have gone into python and successfully ran the following without error.
import selinux
print(selinux.selinux_getpolicytype())
I am trying to do a multinode deployment of kolla-ansible on two of my DL360p's. Everything seems setup well, but when I run the bootstrap I get the following
The full traceback is:
Traceback (most recent call last):
File "/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py", line 107, in <module>
_ansiballz_main()
File "/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.ansible.posix.plugins.modules.selinux',
init_globals=dict(_module_fqn='ansible_collections.ansible.posix.plugins.modules.selinux',
_modlib_path=modlib_path),
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ansi
ble/posix/plugins/modules/selinux.py", line 351, in <module>
File "/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ansi
ble/posix/plugins/modules/selinux.py", line 253, in main
AttributeError: module 'selinux' has no attribute 'selinux_getpolicytype'
fatal: [cirrus-openstack-1]: FAILED! => {
"changed": false,
"module_stderr": "OpenSSH_8.7p1, OpenSSL 3.2.2 4 Jun 2024\r\ndebug1: Reading
configuration data /etc/ssh/ssh_config\r\ndebug3: /etc/ssh/ssh_config line 55: Including
file /etc/ssh/ssh_config.d/50-redhat.conf depth 0\r\ndebug1: Reading configuration data
/etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2: checking match for 'final all' host
192.168.10.8 originally 192.168.10.8\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line
3: not matched 'final'\r\ndebug2: match not found\r\ndebug3: /etc/ssh/ssh_config.d/50-
redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1
(parse only)\r\ndebug1: Reading configuration data /etc/crypto-policies/back-
ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-
sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names ok: [curve25519-
sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-
nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-
group16-sha512,diffie-hellman-group18-sha512]\r\ndebug1: configuration requests final Match
pass\r\ndebug2: resolve_canonicalize: hostname 192.168.10.8 is address\r\ndebug1: re-
parsing configuration\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug3:
/etc/ssh/ssh_config line 55: Including file /etc/ssh/ssh_config.d/50-redhat.conf depth
0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/50-redhat.conf\r\ndebug2:
checking match for 'final all' host 192.168.10.8 originally 192.168.10.8\r\ndebug3:
/etc/ssh/ssh_config.d/50-redhat.conf line 3: matched 'final'\r\ndebug2: match
found\r\ndebug3: /etc/ssh/ssh_config.d/50-redhat.conf line 5: Including file /etc/crypto-
policies/back-ends/openssh.config depth 1\r\ndebug1: Reading configuration data
/etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-curve25519-
sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-]\r\ndebug3: kex names
ok: [curve25519-sha256,[email protected],ecdh-sha2-nistp256,ecdh-sha2-
nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-
sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512]\r\ndebug3: expanded
UserKnownHostsFile '~/.ssh/known_hosts' -> '/root/.ssh/known_hosts'\r\ndebug3: expanded
UserKnownHostsFile '~/.ssh/known_hosts2' -> '/root/.ssh/known_hosts2'\r\ndebug1: auto-mux:
Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2:
mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request
forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3:
mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid =
152168\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1:
mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read
header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared
connection to 192.168.10.8 closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File
\"/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py\", line 107, in <module>\r\n _ansiballz_main()\r\n
File \"/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py\", line 99, in _ansiballz_main\r\n
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File
\"/home/nasica/.ansible/tmp/ansible-tmp-1741317591.7445996-155744-
270946128131361/AnsiballZ_selinux.py\", line 47, in invoke_module\r\n
runpy.run_module(mod_name='ansible_collections.ansible.posix.plugins.modules.selinux',
init_globals=dict(_module_fqn='ansible_collections.ansible.posix.plugins.modules.selinux',
_modlib_path=modlib_path),\r\n File \"<frozen runpy>\", line 226, in run_module\r\n File
\"<frozen runpy>\", line 98, in _run_module_code\r\n File \"<frozen runpy>\", line 88, in
_run_code\r\n File
\"/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ans
ible/posix/plugins/modules/selinux.py\", line 351, in <module>\r\n File
\"/tmp/ansible_selinux_payload_j_scc0l4/ansible_selinux_payload.zip/ansible_collections/ans
ible/posix/plugins/modules/selinux.py\", line 253, in main\r\nAttributeError: module
'selinux' has no attribute 'selinux_getpolicytype'\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
I am prepping the environments with an ansible playbook which installs the following
- name: Ensure required packages are installed
dnf:
name:
- epel-release
- python3.12
- python3.12-devel
- python3.12-pip
- python3-virtualenv
- python3-libselinux
- libselinux-python3
- git
- net-tools
- libffi-devel
- dbus-devel
- openssl-devel
- glib2-devel
- gcc
state: present
I have tried with Python 3.12 and 3.9 with the same result. Would anyone be able to point me in the right direction please? I've lost a day on this and am very excited to get my homelab up and running.
And I have gone into python and successfully ran the following without error.
import selinux
print(selinux.selinux_getpolicytype())
Share
Improve this question
edited Mar 7 at 10:01
U880D
12.3k6 gold badges33 silver badges67 bronze badges
asked Mar 7 at 6:13
NasicaNasica
538 bronze badges
4
|
1 Answer
Reset to default 0Ensure you are using the latest version of the ansible.posix collection.
ansible-galaxy collection install ansible.posix --upgrade
Ensure that the SELinux Python bindings are correctly installed
sudo dnf install python3-libselinux libselinux-python3
Since you've tried both Python 3.12 and 3.9, ensure that the selinux module is compatible with these versions.
Ensure that Ansible is using the correct Python interpreter
[all:vars]
ansible_python_interpreter=/usr/bin/python3.12
Run the Ansible playbook with increased verbosity
ansible-playbook -i inventory playbook.yml -vvv
本文标签:
版权声明:本文标题:python - kolla-ansible bootstrapping error: "module 'selinux' has no attribute 'selinux_getpoli 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744945421a2633746.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
pip install ansible-core>=2.15,<2.16.99'
followed by:pip install --upgrade git+https://opendev./openstack/kolla-ansible@stable/2024.1
andkolla-ansible install-deps
Sometimes the deps are missing on the inventory hosts, some are needed on your working/deploy host. – mzijdemans Commented Mar 13 at 10:25