Skip to content
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

Confict between inline-env-var and command-instead-of-shell #4465

Open
ioah86 opened this issue Jan 5, 2025 · 2 comments
Open

Confict between inline-env-var and command-instead-of-shell #4465

ioah86 opened this issue Jan 5, 2025 · 2 comments
Labels

Comments

@ioah86
Copy link

ioah86 commented Jan 5, 2025

Summary

It appears that the remediation to one issue is causing the rise of a different one.
For the Rule inline-env-var in the current version,
the recommended correction is using ansible.builtin.shell instead of ansible.builtin.command. But the rule command-instead-of-shell requires to use command. Hence, the recommendations should not use ansible.builtin.shell for the correct code or at least include an example using purely ansible.builtin.command.

Issue Type
  • Bug Report
OS / ENVIRONMENT

N/A

STEPS TO REPRODUCE

Read the documentation for inline-env-var and then also read the documentation for command-instead-of-shell. The "fixes" for inline-env-var violate command-instead-of-shell.

Desired Behavior

The recommended and documented fix for one issue should not violate another issue.

Actual Behavior

The recommended and documented fix for one issue should violates another issue.

@ioah86 ioah86 added bug new Triage required labels Jan 5, 2025
@ssbarnea ssbarnea removed the new Triage required label Jan 8, 2025
@ssbarnea
Copy link
Member

ssbarnea commented Jan 8, 2025

This is mostly an incomplete documentation issue because inline-env-var can be sorted in two ways:

  • move the env vars into environment and still use command
  • switch to shell but you will also have to disable the other rule command-instead-of-shell

A PR to improve docs here would be appreciated.

@ioah86
Copy link
Author

ioah86 commented Jan 9, 2025

Okay, so these are the two options then. I was wondering if there are other ways. The second one seems a bit unclean to be part of the official doc. I am happy to create a PR with the first option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants