community.general icon indicating copy to clipboard operation
community.general copied to clipboard

modprobe Ignores "--check" Mode When Using "persistent:" Option

Open salmon111 opened this issue 1 year ago • 2 comments

Summary

When running an Ansible playbook using the community.general.modprobe module with the "persistent" option, the "--check" mode does not function as expected. Instead of only checking for changes, the module performs actions that should be deferred in "--check" mode.

Issue Type

Bug Report

Component Name

modprobe

Ansible Version

$ pipenv run ansible --version
ansible [core 2.17.5]
  python version = 3.12.4 (main, Jun  7 2024, 04:28:19) [Clang 14.0.0 (clang-1400.0.29.202)] 
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ pipenv run ansible-galaxy collection list community.general
Community.general Version
Collection        Version
----------------- -------
community.general 9.5.0  

Configuration

$ pipenv run ansible-config dump --only-changed
CONFIG_FILE() = /**/ansible/ansible.cfg
DEPRECATION_WARNINGS(/**/ansible/ansible.cfg) = False
HOST_KEY_CHECKING(/**/ansible/ansible.cfg) = False
INTERPRETER_PYTHON(/**/ansible/ansible.cfg) = /usr/bin/python3

OS / Environment

MacOS Monterey 12.7.6 MacBook Pro (13-inch, M1, 2020)

Steps to Reproduce

  1. Create an Ansible playbook with the following task
- name: Load dummy module
  community.general.modprobe:
    name: dummy
    persistent: present
    # persistent: absent
  1. Run the playbook in --check mode
ansible-playbook playbook.yml --check
  1. Observe that the module is actually modified (e.g., persistence is altered), even though --check mode should only simulate changes without applying them.

Expected Results

In --check mode, the community.general.modprobe module with the persistent option should simulate changes without making actual modifications. No modules should be loaded or unloaded, and persistence should not be altered; only a report of potential changes should be provided.

Actual Results


Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

salmon111 avatar Oct 22 '24 10:10 salmon111