8000 --syntax-check isn't catching indent errors for with_items: · Issue #1924 · ansible/ansible-navigator · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

--syntax-check isn't catching indent errors for with_items: #1924

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

Open
VorlMaldor opened this issue Feb 25, 2025 · 0 comments
Open

--syntax-check isn't catching indent errors for with_items: #1924

VorlMaldor opened this issue Feb 25, 2025 · 0 comments
Labels
bug Researched, reproducible, committed to fix

Comments

@VorlMaldor
Copy link
VorlMaldor commented Feb 25, 2025
ISSUE TYPE
  • Bug Report
SUMMARY

when using the ansible-navigator run --syntax-check the check does not catch indent issues with with_items:

ANSIBLE-NAVIGATOR VERSION
ansible-navigator 24.9.0

CONFIGURATION
LOG FILE

TASK [copy repo file to /etc/yum.repos.d/local_rhel9.repo] ********************************************
fatal: [lab-cn]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'item' is undefined. 'item' is undefined\n\nThe error appears to be in '/home/sboni/ansible/lab/install-repo.yaml': line 5, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: "copy repo file to /etc/yum.repos.d/local_rhel9.repo"\n ^ here\n"}

STEPS TO REPRODUCE

use ansible.builtin.copy and with_items: but have with_items being at the indent of the rest of the copy section like this

  1 - name: "copy repo files and update subscription-manager plugin"
  2   hosts: rhel9
  3   tasks:
  4
  5   - name: "copy repo file to /etc/yum.repos.d/local_rhel9.repo"
  6     ansible.builtin.copy:
  7       src: "{{ item.src }}"
  8       dest: "{{ item.dest }}"
  9       owner: root
 10       group: root
 11       mode: 644
 12
 13       with_items:
 14       - { src: '/etc/yum.repos.d/local_rhel9.repo',dest: '/etc/yum.repos.d/local_rhel9.repo' }
 15       - { src: '/etc/yum/pluginconf.d/subscription-manager.conf',dest: '/etc/yum/pluginconf.d/subsc    ription-manager.conf' }

then run ansible-navigator run .yaml --syntax-check

EXPECTED RESULTS

I would expect syntax-check to tell me there was an issue with the indent

ACTUAL RESULTS

ansible-navigator comes back with no errors

ADDITIONAL INFORMATION

ansible-navigator images ee-supported-rhel8 -m stdout

  • created: 2 weeks ago
    execution_environment: true
    full_name: registry.redhat.io/ansible-automation-platform-25/ee-supported-rhel8:latest
    image_id: 6b2954c3d094
@VorlMaldor VorlMaldor added bug Researched, reproducible, committed to fix new New issues and PRs to triaged labels Feb 25, 2025
@alisonlhart alisonlhart removed the new New issues and PRs to triaged label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Researched, reproducible, committed to fix
Projects
Status: No status
Development

No branches or pull requests

2 participants
0