-
Notifications
You must be signed in to change notification settings - Fork 664
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
Core module arguments are not validated #4311
Comments
I believe the issue you're seeing, at least for the ansible-lint/src/ansiblelint/rules/args.py Lines 163 to 168 in 3b5bee1
|
It appears you are correct. I found some modules that did not have action plugins with the same name ( This is the intended behavior then? Below is an example of the - name: Test task
ansible.builtin.apt:
name: test
sdf: stuff
state: present WARNING Listing 2 violation(s) that are fatal
args[module]: Unsupported parameters for (basic.py) module: sdf. Supported parameters include: allow_change_held_packages, allow_downgrade, allow_unauthenticated, autoclean, autoremove, cache_valid_time, clean, deb, default_release, dpkg_options, fail_on_autoremove, force, force_apt_get, install_recommends, lock_timeout, only_upgrade, package, policy_rc_d, purge, state, update_cache, update_cache_retries, update_cache_retry_max_delay, upgrade (allow-downgrade, allow-downgrades, allow-unauthenticated, allow_downgrades, default-release, install-recommends, name, pkg, update-cache). (warning) |
It's probably what's intended. Unless that is now open to change. @tanwigeetika1618 I see you assigned yourself to the issue, do you have any thoughts? |
@cavcrosby We kinda got stuck on this one. Do you have any idea on how we can address it? I still consider that we should be able to validate the arguments, especially for core plugins. Sadly neither |
It seems that ansible/ansible#79720 might address this. |
I think it's worth waiting to see ansible/ansible#79720 get merged in. Kicking the tires this morning (see cavcrosby@a02914e), I see a much easier path forward utilizing the changes that should come from that PR instead of trying an alternative solution. We might even be able to simplify the argument validation for modules too with these changes. |
Summary
Incorrect module arguments no longer trigger a
args[module]
error foransible.builtin
modules when using anyansible-lint
that is version24.5.0
or higher, including the current version24.7.0
. This is not the case with the versions I've tested including24.2.3
,6.22.2
, and6.14.3
.Issue Type
OS / ENVIRONMENT
STEPS TO REPRODUCE
Run
ansible-lint <insert_playbook_name>.yml
when an incorrect module argument is present in a playbook and theansible-lint
version is>=24.5.0
. The example below uses theansible.builtin.dnf
module, but this has also been tested with theansible.builtin.package
module. Running with a non-builtin module such ascommunity.general.flatpak_remote
did trigger the error correctly.Desired Behavior
Output similar to the following should occur for
ansible.builtin
modules.Actual Behavior
Please give some details of what is happening. Include a [minimum complete
verifiable example] with:
ansible-playbook --syntax-check playbook
See Gist for minimal playbook
https://gist.github.com/TheSpy0/c698fbe4089723c853cb4844b3592940
The text was updated successfully, but these errors were encountered: