ansible-lint
ansible-lint copied to clipboard
ansible-lint[risky-shell-pipe] misinterprets pipe in comment when using Multiline Block Scalars
Summary
The ansible-lint[risky-shell-pipe] rule misinterprets pipe in comment when using Multiline Block Scalars ( | or > )
Issue Type
- Bug Report
OS / ENVIRONMENT
> ansible-lint --version
ansible-lint 24.7.0 using ansible-core:2.17.1 ansible-compat:24.7.0 ruamel-yaml:0.18.6 ruamel-yaml-clib:0.2.8
- ansible installation method: ansible-dev-tools devcontainer - ghcr.io/ansible/community-ansible-dev-tools:latest
- ansible-lint installation method: ansible-dev-tools devcontainer - ghcr.io/ansible/community-ansible-dev-tools:latest
STEPS TO REPRODUCE
Create the below test.yml and run it through the linter
---
- name: "Write crontab header for {{ postgresql_svc_user }}"
become: true
ansible.builtin.shell: |
cat <<EOF >> crontab_temp.txt ## | +---------------- hour (0 - 23)
changed_when: true
...
Desired Behavior
Expected behavior is the pipes in comments are interpreted correctly and not flagged for risky-shell-pipe rule.