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

WARNING Unable to resolve FQCN for module ansible.builtin.include #3696

Closed
lisenet opened this issue Aug 30, 2023 · 0 comments · Fixed by #3715
Closed

WARNING Unable to resolve FQCN for module ansible.builtin.include #3696

lisenet opened this issue Aug 30, 2023 · 0 comments · Fixed by #3715
Assignees
Labels
Milestone

Comments

@lisenet
Copy link

lisenet commented Aug 30, 2023

Summary

Ansible-lint cannot resolve FQCN for module ansible.builtin.include.

Issue Type
  • Bug Report
OS / ENVIRONMENT
ansible-lint --version
ansible-lint 6.18.0 using ansible-core:2.15.3 ansible-compat:4.1.6 ruamel-yaml:None ruamel-yaml-clib:None
  • ansible installation method: pip
  • ansible-lint installation method: pip
  • OS: Rocky 9.2
  • Python: 3.9
STEPS TO REPRODUCE

Running ansible-lint against the following piece of code results in a violation of the rule fqcn[action-core].

---
- name: Include playbook
  include: Linux.yml
  when: ansible_system == 'Linux'

Resolving the issue by using an FQCN (see documentation here) below results in the warning reported in this issue:

---
- name: Include playbook
  ansible.builtin.include: Linux.yml
  when: ansible_system == 'Linux'

Ansible-lint output:

WARNING  Unable to resolve FQCN for module ansible.builtin.include

Ansible-lint configuration below.

---
# .ansible-lint
profile: production

exclude_paths:
  - collections

parseable: true
quiet: true
strict: true
verbosity: 1

var_naming_pattern: "^[a-z_][a-z0-9_]*$"

use_default_rules: true

skip_list:
  - role-name
  - deprecated-module
  - yaml[line-length]

enable_list:
  - args
  - empty-string-compare # opt-in
  - no-log-password # opt-in
  - no-same-owner # opt-in
  - name[prefix] # opt-in
  - yaml

offline: true
Desired Behavior

No warning is printed when FQCN is used.

Actual Behavior
  • minimised playbook to reproduce the error:
---
- name: Include playbook
  include: Linux.yml
  when: ansible_system == 'Linux'
  • the output of running ansible-lint including the command line used:
ansible-lint roles/hl.timezone
WARNING  Unable to resolve FQCN for module ansible.builtin.include
@lisenet lisenet added bug new Triage required labels Aug 30, 2023
@shatakshiiii shatakshiiii removed the new Triage required label Aug 30, 2023
@ssbarnea ssbarnea added this to the 6.19.x milestone Aug 30, 2023
ssbarnea added a commit that referenced this issue Sep 5, 2023
- move module loading code in utils module
- mimic core behavior and fallback on legacy modules

Fixes: #3696
ssbarnea added a commit that referenced this issue Sep 5, 2023
- move module loading code in utils module
- mimic core behavior and fallback on legacy modules

Fixes: #3696
@ssbarnea ssbarnea modified the milestones: 6.19.x, 6.20.x Sep 6, 2023
ssbarnea added a commit that referenced this issue Nov 27, 2023
- move module loading code in utils module
- mimic core behavior and fallback on legacy modules

Fixes: #3696
ssbarnea added a commit that referenced this issue Nov 27, 2023
- move module loading code in utils module
- mimic core behavior and fallback on legacy modules

Fixes: #3696
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