--syntax-check isn't catching indent errors for with_items: · Issue #1924 · ansible/ansible-navigator · GitHub
More Web Proxy on the site http://driver.im/
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
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
ISSUE TYPE
SUMMARY
when using the ansible-navigator run --syntax-check the check does not catch indent issues with with_items:
ANSIBLE-NAVIGATOR VERSION
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
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
execution_environment: true
full_name: registry.redhat.io/ansible-automation-platform-25/ee-supported-rhel8:latest
image_id: 6b2954c3d094
The text was updated successfully, but these errors were encountered: