I was able to reproduce the issue locally with the latest ansible-lint 6.12.1:
Passes with ansible-lint 6.11.0
~~~
$ ansible-lint --version
ansible-lint 6.11.0 using ansible 2.14.2
A new release of ansible-lint is available: 6.11.0 → 6.12.1
(pep8) [sandeepyadav@localhost tripleo-heat-templates]$ ansible-lint -v
INFO Set ANSIBLE_LIBRARY=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/modules:/home/sandeepyadav/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/collections:/home/sandeepyadav/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/roles:roles:/home/sandeepyadav/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Discovered files to lint using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --cached --others --exclude-standard -z
INFO Excluded removed files using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --deleted -z
INFO Executing syntax check on common/deploy-steps-playbooks-common.yaml (0.55s)
WARNING Unable to resolve FQCN for module tripleo_all_nodes_data
~~~
Fails with ansible-lint 6.12.1
~~~
$ python3 -m pip install ansible-lint --upgrade
$ ansible-lint --version
ansible-lint 6.12.1 using ansible 2.14.2
]$ ansible-lint -v
WARNING Ignore loading rule from /tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/rules/galaxy.py due to No module named 'pytest'
INFO Set ANSIBLE_LIBRARY=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/modules:/home/sandeepyadav/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/collections:/home/sandeepyadav/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/sandeepyadav/.cache/ansible-compat/a4a0a3/roles:roles:/home/sandeepyadav/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles
INFO Discovered files to lint using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --cached --others --exclude-standard -z
INFO Excluded removed files using: git -c safe.directory=/tmp/tripleo-heat-templates ls-files --deleted -z
Traceback (most recent call last):
File "/tmp/tripleo-heat-templates/.tox/pep8/bin/ansible-lint", line 8, in <module>
sys.exit(_run_cli_entrypoint())
File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/__main__.py", line 349, in _run_cli_entrypoint
sys.exit(main(sys.argv))
File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/__main__.py", line 244, in main
result = _get_matches(rules, options)
File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/runner.py", line 220, in _get_matches
lintables = ansiblelint.utils.get_lintables(opts=options, args=options.lintables)
File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/utils.py", line 870, in get_lintables
lintables.append(Lintable(path))
File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/file_utils.py", line 245, in __init__
self._guess_kind()
File "/tmp/tripleo-heat-templates/.tox/pep8/lib/python3.9/site-packages/ansiblelint/file_utils.py", line 249, in _guess_kind
if isinstance(self.data, list) and "hosts" in self.data[0]:
IndexError: list index out of range
~~~
Hello,
The latest affected job is using ansible-lint-6.12.1 [1]. Last good was using ansible- lint-6. 11.0.
ansible-6.12.0/.1 was recently released(4 days ago): https:/ /github. com/ansible/ ansible- lint/releases. 6.12.0 is affected as well.
I was able to reproduce the issue locally with the latest ansible-lint 6.12.1:
Passes with ansible-lint 6.11.0
~~~
$ ansible-lint --version
ansible-lint 6.11.0 using ansible 2.14.2
A new release of ansible-lint is available: 6.11.0 → 6.12.1 localhost tripleo- heat-templates] $ ansible-lint -v LIBRARY= /home/sandeepya dav/.cache/ ansible- compat/ a4a0a3/ modules: /home/sandeepya dav/.ansible/ plugins/ modules: /usr/share/ ansible/ plugins/ modules COLLECTIONS_ PATH=/home/ sandeepyadav/ .cache/ ansible- compat/ a4a0a3/ collections: /home/sandeepya dav/.ansible/ collections: /usr/share/ ansible/ collections ROLES_PATH= /home/sandeepya dav/.cache/ ansible- compat/ a4a0a3/ roles:roles: /home/sandeepya dav/.ansible/ roles:/ usr/share/ ansible/ roles:/ etc/ansible/ roles /tmp/tripleo- heat-templates ls-files --cached --others --exclude-standard -z /tmp/tripleo- heat-templates ls-files --deleted -z deploy- steps-playbooks -common. yaml (0.55s) all_nodes_ data
(pep8) [sandeepyadav@
INFO Set ANSIBLE_
INFO Set ANSIBLE_
INFO Set ANSIBLE_
INFO Discovered files to lint using: git -c safe.directory=
INFO Excluded removed files using: git -c safe.directory=
INFO Executing syntax check on common/
WARNING Unable to resolve FQCN for module tripleo_
~~~
Fails with ansible-lint 6.12.1
~~~
$ python3 -m pip install ansible-lint --upgrade
$ ansible-lint --version
ansible-lint 6.12.1 using ansible 2.14.2
]$ ansible-lint -v heat-templates/ .tox/pep8/ lib/python3. 9/site- packages/ ansiblelint/ rules/galaxy. py due to No module named 'pytest' LIBRARY= /home/sandeepya dav/.cache/ ansible- compat/ a4a0a3/ modules: /home/sandeepya dav/.ansible/ plugins/ modules: /usr/share/ ansible/ plugins/ modules COLLECTIONS_ PATH=/home/ sandeepyadav/ .cache/ ansible- compat/ a4a0a3/ collections: /home/sandeepya dav/.ansible/ collections: /usr/share/ ansible/ collections ROLES_PATH= /home/sandeepya dav/.cache/ ansible- compat/ a4a0a3/ roles:roles: /home/sandeepya dav/.ansible/ roles:/ usr/share/ ansible/ roles:/ etc/ansible/ roles /tmp/tripleo- heat-templates ls-files --cached --others --exclude-standard -z /tmp/tripleo- heat-templates ls-files --deleted -z heat-templates/ .tox/pep8/ bin/ansible- lint", line 8, in <module> exit(_run_ cli_entrypoint( )) heat-templates/ .tox/pep8/ lib/python3. 9/site- packages/ ansiblelint/ __main_ _.py", line 349, in _run_cli_entrypoint exit(main( sys.argv) ) heat-templates/ .tox/pep8/ lib/python3. 9/site- packages/ ansiblelint/ __main_ _.py", line 244, in main heat-templates/ .tox/pep8/ lib/python3. 9/site- packages/ ansiblelint/ runner. py", line 220, in _get_matches utils.get_ lintables( opts=options, args=options. lintables) heat-templates/ .tox/pep8/ lib/python3. 9/site- packages/ ansiblelint/ utils.py" , line 870, in get_lintables append( Lintable( path)) heat-templates/ .tox/pep8/ lib/python3. 9/site- packages/ ansiblelint/ file_utils. py", line 245, in __init__ _guess_ kind() heat-templates/ .tox/pep8/ lib/python3. 9/site- packages/ ansiblelint/ file_utils. py", line 249, in _guess_kind self.data, list) and "hosts" in self.data[0]:
WARNING Ignore loading rule from /tmp/tripleo-
INFO Set ANSIBLE_
INFO Set ANSIBLE_
INFO Set ANSIBLE_
INFO Discovered files to lint using: git -c safe.directory=
INFO Excluded removed files using: git -c safe.directory=
Traceback (most recent call last):
File "/tmp/tripleo-
sys.
File "/tmp/tripleo-
sys.
File "/tmp/tripleo-
result = _get_matches(rules, options)
File "/tmp/tripleo-
lintables = ansiblelint.
File "/tmp/tripleo-
lintables.
File "/tmp/tripleo-
self.
File "/tmp/tripleo-
if isinstance(
IndexError: list index out of range
~~~
[1] https:/ /storage. gra.cloud. ovh.net/ v1/AUTH_ dcaab5e32b234d5 6b626f72581e364 4c/zuul_ opendev_ logs_f2f/ 872568/ 2/check/ openstack- tox-pep8/ f2f734e/ job-output. txt
[2] https:/ /storage. bhs.cloud. ovh.net/ v1/AUTH_ dcaab5e32b234d5 6b626f72581e364 4c/zuul_ opendev_ logs_5fc/ 868660/ 2/gate/ openstack- tox-pep8/ 5fc69e9/ job-output. txt