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

per task silencing of warnings #13468

Closed
phy1729 opened this issue Dec 8, 2015 · 5 comments
Closed

per task silencing of warnings #13468

phy1729 opened this issue Dec 8, 2015 · 5 comments
Labels
feature This issue/PR relates to a feature request.

Comments

@phy1729
Copy link
Contributor

phy1729 commented Dec 8, 2015

Issue Type:

Feature Idea

Ansible Version:

ansible 2.0.0 (detached HEAD 958da26)

Ansible Configuration:

None.

Environment:

N/A

Summary:

If I have an task like

shell: curl -s http://some.url.example/foo | sed '/asdf /!d;s///'

I get a bright pink warning

[WARNING]: Consider using get_url module rather than running curl

It'd be nice if this warning could be turned off on a per task basis. The warnings are useful in general, but sometimes they are false positives and the author knows better.

Steps To Reproduce:
- shell: curl -s http://some.url.example/foo | sed '/asdf /!d;s///'
  ignore_warnings: yes

Would not have the bright pink warning.

@quentinsf
Copy link
Contributor

Agreed - I've just switched to 2.0, and I get warnings when I use 'git' to do something that the git module can't do, and 'tar' to do something that the unarchive module can't do.

It would be very nice to be able to override them.

@CodeSturgeon
Copy link

It would be nice to have the warnings suppressed explicitly as above, but it can be done inline. Just add warn=no to the the command/shell play. It's in the config docs and it's a listed in the command and shell modules. I mention that here as I found this issue before the docs.

@dmromanov
Copy link

@quentinsf In this case it would be better to fix modules so they would not throw warnings on tasks they could not do. Silencing them would be just a work-around.

In addition it would be great if warn=no would be moved from module-level API (shell, command) to a global level (correct me if I am wrong) like become. So it could be used on a specific task as well on an entire playbook

@bcoca
Copy link
Member

bcoca commented Feb 10, 2016

shell has 'warn' option since 1.8 that controls this, closing as 'already implemented'

@mahemoff
Copy link
Contributor

Example usage:

- name: Check the folder
  shell: ls ./somedir
  args:
    warn: false

shell docs

@ansibot ansibot added feature This issue/PR relates to a feature request. and removed feature_idea labels Mar 2, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue/PR relates to a feature request.
Projects
None yet
Development

No branches or pull requests

8 participants