-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
modprobe (without params) with persistent fails if /etc/modprobe.d does not exists #7717
Comments
Files identified in the description: If these files are incorrect, please update the |
This does not have a PR, btw, not sure why the bot thinks so ? |
The bot sees that a PR is referencing this issue, hence it adds the |
Potentially not, see #8033 (comment). Can someone verify that it still crashes in this case when it tries to modify something? |
@felixfontein It still crashes. any workaround? |
@olarike put a Even if this is fixed in a better way, the module will still fail if the directory does not exist. So if you want your play to pass in that case, you need to ensure yourself that the directory exists. |
Summary
When you try to execute the following:
And the directory
/etc/modprobe.d
does not exists on the host, modprobe fails with a FileNotFound excetpion when trying to find a module parameters under/etc/modprobe.d
This came up in kubespray in kubernetes-sigs/kubespray#10677
Issue Type
Bug Report
Component Name
modprobe
Ansible Version
ansible [core 2.15.6]
config file = None
configured module search path = ['/home/andrei/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/andrei/.pyenv/versions/kubespray/lib/python3.11/site-packages/ansible
ansible collection location = /home/andrei/.ansible/collections:/usr/share/ansible/collections
executable location = /home/andrei/.pyenv/versions/kubespray/bin/ansible
python version = 3.11.6 (main, Nov 25 2023, 11:49:51) [GCC 13.2.1 20230801] (/home/andrei/.pyenv/versions/kubespray/bin/python3)
jinja version = 3.1.2
libyaml = True
Community.general Version
Configuration
No response
OS / Environment
Linux 5.15.138-flatcar x86_64
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=3602.2.2
VERSION_ID=3602.2.2
BUILD_ID=2023-11-20-1825
SYSEXT_LEVEL=1.0
PRETTY_NAME="Flatcar Container Linux by Kinvolk 3602.2.2 (Oklo)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar.org/"
BUG_REPORT_URL="https://issues.flatcar.org"
FLATCAR_BOARD="amd64-usr"
CPE_NAME="cpe:2.3:o:flatcar-linux:flatcar_linux:3602.2.2:::::::*"
Steps to Reproduce
Put the following task in a playbook, execute on Flatcar host.
Alternatively, use
ansible -m community.general.modrobe -a 'name=br_netfilter state=present persistent=present
on a Flatcar host (or any host not having/etc/modprobe.d
)Expected Results
Two differents things:
params
parameter, modprobe should not fails on the absence of/etc/modprobe.d
params
is specified, modprobe should create/etc/modprobe.d
on demand.Actual Results
(This is from the kubespray bug-report, reformatted for readability)
TL;DR (if my understanding of modprobe.d is correct) : modprobe try to found the file for the params of the module it handles, and fails because the parent directory does not exist.
Code of Conduct
The text was updated successfully, but these errors were encountered: