You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ansible lint is not doing the normal import behaviour is the import_ tasks are specified with the FQCN format in roles. The only user facing message is that the task is not named as highlighted on #1615.
The behaviour is different playbooks and it does load and properly validate those files.
The issue relates to play_children and how the tasks are getting compared as they aren't normalized when they hit it. Adding in a simple "ansible.builtin.import_tasks": _include_children, line here does trigger the file to be loaded but likely isn't the proper solution.
ansible-lint installation method: one of source, pip
OS / ENVIRONMENT
Debian 11
STEPS TO REPRODUCE
Case 1 playbooks
fqcn_failure.yml
---- hosts: all tasks: - ansible.builtin.import_tasks: second.yml
second.yml
---invalid_yaml
Case 2 playbooks
/etc/ansible/roles/lint/tasks/main.yml
---- ansible.builtin.import_tasks: second.yml
/etc/ansible/roles/lint/tasks/second.yml
---invalid_yaml
Desired Behaviour
Import cases operate consistently.
Actual Behaviour
Case 1 - second.yml imported and checked correctly
# ansible-lint working.ymlWARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: working.ymlWARNING Listing 1 violation(s) that are fatalsyntax-check: included task files must contain a list of taskssecond.yml:2:1 ERROR! included task files must contain a list of tasksThe error appears to be in '/ansible_lint_fqcn_test_case/second.yml': line 2, column 1, but maybe elsewhere in the file depending on the exact syntax problem.The offending line appears to be:---invalid_yaml^ here
Case 2 - no import of invalid second.yml in the role, only the unnamed-task error.
# ansible-lint /etc/ansible/roles/lint/tasks/main.ymlWARNING Listing 1 violation(s) that are fatalunnamed-task: All tasks should be namedetc/ansible/roles/lint/tasks/main.yml:2 Task/Handler: import_tasks second.yml
The text was updated successfully, but these errors were encountered:
Summary
Ansible lint is not doing the normal import behaviour is the import_ tasks are specified with the FQCN format in roles. The only user facing message is that the task is not named as highlighted on #1615.
The behaviour is different playbooks and it does load and properly validate those files.
The issue relates to play_children and how the tasks are getting compared as they aren't normalized when they hit it. Adding in a simple
"ansible.builtin.import_tasks": _include_children,
line here does trigger the file to be loaded but likely isn't the proper solution.Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Debian 11
STEPS TO REPRODUCE
Case 1 playbooks
fqcn_failure.yml
second.yml
Case 2 playbooks
/etc/ansible/roles/lint/tasks/main.yml
/etc/ansible/roles/lint/tasks/second.yml
Desired Behaviour
Import cases operate consistently.
Actual Behaviour
Case 1 - second.yml imported and checked correctly
Case 2 - no import of invalid second.yml in the role, only the
unnamed-task
error.The text was updated successfully, but these errors were encountered: