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
---
- name: Sample
hosts: all
tasks:
- name: Generate keypair
community.crypto.openssh_keypair:
path: "{{ env.path }}"
when: ( env.path is not none )
the output of running ansible-lint including the command line used
ansible-lint --profile basic --write=all playbooks/5_setup_bastion.yaml
INFO Identified /var/tmp/work/Ansible-OpenShift-Provisioning as project root due config file /var/tmp/work/Ansible-OpenShift-Provisioning/.ansible-lint.
INFO Set ANSIBLE_LIBRARY=/home/ttakamiy/.cache/ansible-compat/184aba/modules:/home/ttakamiy/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/ttakamiy/.cache/ansible-compat/184aba/collections:/home/ttakamiy/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/ttakamiy/.cache/ansible-compat/184aba/roles:roles:/var/tmp/work/Ansible-OpenShift-Provisioning/roles
INFO Set ANSIBLE_LIBRARY=/home/ttakamiy/.cache/ansible-compat/184aba/modules:/home/ttakamiy/.ansible/plugins/modules:/usr/share/ansible/plugins/modules
INFO Set ANSIBLE_COLLECTIONS_PATH=/home/ttakamiy/.cache/ansible-compat/184aba/collections:/home/ttakamiy/.ansible/collections:/usr/share/ansible/collections
INFO Set ANSIBLE_ROLES_PATH=/home/ttakamiy/.cache/ansible-compat/184aba/roles:roles:/var/tmp/work/Ansible-OpenShift-Provisioning/roles
INFO Executing syntax check on playbook playbooks/5_setup_bastion.yaml (0.41s)
Traceback (most recent call last):
File "/var/tmp/work/venv/bin/ansible-lint", line 8, in <module>
sys.exit(_run_cli_entrypoint())
^^^^^^^^^^^^^^^^^^^^^
File "/var/tmp/work/venv/lib64/python3.11/site-packages/ansiblelint/__main__.py", line 317, in _run_cli_entrypoint
sys.exit(main(sys.argv))
^^^^^^^^^^^^^^
File "/var/tmp/work/venv/lib64/python3.11/site-packages/ansiblelint/__main__.py", line 281, in main
_do_transform(result, options)
File "/var/tmp/work/venv/lib64/python3.11/site-packages/ansiblelint/__main__.py", line 192, in _do_transform
transformer.run()
File "/var/tmp/work/venv/lib64/python3.11/site-packages/ansiblelint/transformer.py", line 110, in run
self._do_transforms(file, ruamel_data or data, file_is_yaml, matches)
File "/var/tmp/work/venv/lib64/python3.11/site-packages/ansiblelint/transformer.py", line 147, in _do_transforms
match.rule.transform(match, file, data)
File "/var/tmp/work/venv/lib64/python3.11/site-packages/ansiblelint/rules/jinja.py", line 422, in transform
self._transform_spacing(match, data)
File "/var/tmp/work/venv/lib64/python3.11/site-packages/ansiblelint/rules/jinja.py", line 461, in _transform_spacing
obj[path[-1]][key] = match.transform_meta.fixed
~~~~^^^^
IndexError: list index out of range
if you're getting a stack trace, also the output of ansible-playbook --syntax-check playbook
ansible-playbook --syntax-check playbooks/5_setup_bastion.yaml
[WARNING]: Unable to parse /var/tmp/work/Ansible-OpenShift-Provisioning/inventories/default as an inventory
source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not
match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: jumphost
[WARNING]: Could not match supplied host pattern, ignoring: bastion
[WARNING]: Could not match supplied host pattern, ignoring: kvm_host
playbook: playbooks/5_setup_bastion.yaml
The text was updated successfully, but these errors were encountered:
Summary
IndexError is thrown from jinja.py with basic profile and --write=all option
Issue Type
OS / ENVIRONMENT
ansible-lint 6.19.0 using ansible-core:2.15.4 ansible-compat:4.1.10 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7
STEPS TO REPRODUCE
Desired Behavior
No error occurs.
Actual Behavior
IndexError: list index out of range
error occurs.ansible-playbook --syntax-check playbook
The text was updated successfully, but these errors were encountered: