Skip to content
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

Ansible lint run for autofixing the module fqcn is not happening as expected #4114

Closed
justjais opened this issue Apr 17, 2024 · 0 comments · Fixed by #4125
Closed

Ansible lint run for autofixing the module fqcn is not happening as expected #4114

justjais opened this issue Apr 17, 2024 · 0 comments · Fixed by #4125
Assignees
Labels

Comments

@justjais
Copy link

Summary

Ansible lint run for autofixing the module fqcn is not happening as expected

Issue Type
  • Bug Report
OS / ENVIRONMENT

ran over mac os

ansible-lint --version
ansible-lint 24.2.2 using ansible-core:2.16.4 ansible-compat:4.1.11 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
  • ansible installation method: one of source, pip, OS package
  • ansible-lint installation method: one of source, pip, OS package
STEPS TO REPRODUCE
  • Run ansible-lint with autofix enabled over repo: test-22851
  • Lint completes the parsing and result in modified files, but it doesn't autofix the FQCN for multiple playbooks, both in roles and playbook folder
    ref run:
(.env) ➜  test-aap-22851 git:(main) ansible-lint --fix --config-file=./ansible-lint-config.yml

WARNING  Skipped installing collection dependencies due to running in offline mode.
WARNING  Listing 7 violation(s) that are fatal
syntax-check[unknown-module]: couldn't resolve module/action 'ilo_device'. This often indicates a misspelling, missing collection, or incorrect module path.
playbooks/Chassis/get_device_inventory_info.yml:23:11syntax-check[unknown-module]: couldn't resolve module/action 'ilo_device'. This often indicates a misspelling, missing collection, or incorrect module path.
playbooks/Chassis/indicator_led_off.yml:18:7syntax-check[unknown-module]: couldn't resolve module/action 'ilo_device'. This often indicates a misspelling, missing collection, or incorrect module path.
playbooks/Chassis/indicator_led_on.yml:18:7syntax-check[unknown-module]: couldn't resolve module/action 'ilo_manage'. This often indicates a misspelling, missing collection, or incorrect module path.
playbooks/User/check_user_privileges.yml:14:11syntax-check[specific]: the role 'getBiosattr' was not found in /Users/sjaiswal/Sumit/wisdom/botConfigRules/test-aap-22851/playbooks/roles:/Users/sjaiswal/.cache/ansible-compat/00a78a/roles:/Users/sjaiswal/Sumit/wisdom/botConfigRules/test-aap-22851/roles:/Users/sjaiswal/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/sjaiswal/Sumit/wisdom/botConfigRules/test-aap-22851/playbooks
playbooks/automation.yml:28:7syntax-check[unknown-module]: couldn't resolve module/action 'ilo_manage'. This often indicates a misspelling, missing collection, or incorrect module path.
roles/check_user_privileges/tasks/main.yml:10:7syntax-check[unknown-module]: couldn't resolve module/action 'ilo_storage'. This often indicates a misspelling, missing collection, or incorrect module path.
roles/create_logical_drives/tasks/main.yml:19:7
Modified 38 files.
                     Rule Violation Summary
 count tag                          profile rule associated tags
     1 syntax-check[specific]       min     core, unskippable
     6 syntax-check[unknown-module] min     core, unskippableFailed: 7 failure(s), 0 warning(s) on 63 files.
Desired Behavior

Ansible lint run should autofix the FQCN for all of the playbooks available inside the repository roles/playbooks.

Actual Behavior

Post above run playbook from repo playbook folder and roles folder are not updated for FQCN as expected, ref role: "check_user_privileges/tasks/main.yml" run result, same with playbook folder playbooks where debug, set_fact, and copy modules are not being updated with relevant fqcn which in this case is "ansible.builtin".

Ansible-lint config:

---
exclude_paths:
  - .github/
  - .git/
  - .vscode/
  - .devcontainer/
  - changelogs/
  - .cache/
  - .pre-commit-config.yaml

write_list:
  - all
@justjais justjais added bug new Triage required labels Apr 17, 2024
ssbarnea added a commit that referenced this issue Apr 17, 2024
This fixes a misleading message about use of offline mode that
originates from ansible-compat when get_app was called multiple
times, even when the linter was not really running in offline mode.

Related: #4114
@audgirka audgirka removed the new Triage required label Apr 17, 2024
@ssbarnea ssbarnea pinned this issue Apr 29, 2024
ssbarnea added a commit that referenced this issue Apr 29, 2024
ssbarnea added a commit that referenced this issue Apr 30, 2024
@ssbarnea ssbarnea unpinned this issue Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants