Make modprobe module check for builtins as well (#37150)

Without this modprobe always reports changed when modprobe-ing a builtin module.

With this, if a kernel module is a builtin, the modprobe module will:
- succeed (without incorrectly reporting changed) if ``state`` is ``present``;
- fail if ``state`` is ``absent``

The failure will have whatever error message modprobe returns when
attempting to remove a builtin module. For example:
``modprobe: ERROR: Module nfs is builtin.``
This commit is contained in:
Jacob Floyd
2018-12-20 15:30:29 -06:00
committed by Alicia Cozine
parent 76450fd1c2
commit 069e0b8d57
3 changed files with 25 additions and 7 deletions

View File

@@ -0,0 +1,3 @@
---
bugfixes:
- "modprobe - The modprobe module now detects builtin kernel modules. If a kernel module is builtin the modprobe module will now: succeed (without incorrectly reporting changed) if ``state`` is ``present``; and fail if ``state`` is ``absent`` (with an error message like ``modprobe: ERROR: Module nfs is builtin.``). (https://github.com/ansible/ansible/pull/37150)"