There is no built in way to achieve this.  You could write your own
`stdout` callback plugin that overrides the `_dump_results` method, to not
display results when `no_log` was specified, and then register that
callback plugin in your ansible.cfg file.

On Tue, Aug 30, 2016 at 12:19 PM, johhue <[email protected]> wrote:

>
> Anyone ... anyone ... Bueller?
>
>
> On Friday, August 26, 2016 at 10:46:04 AM UTC-7, johhue wrote:
>>
>> Hello,
>>
>> I am getting ready to have our general populace execute patches using
>> Ansible. We are running playbooks with wrapper shell scripts at the moment
>> and do not have Tower evaluated yet.
>>
>> I would like to control what messages appears to them in the output of
>> plays. Ansible is extremely verbose.
>>
>> Not everyone understands the JSON formatting and anything "red" or with
>> the "ERROR" string usually we get the hands thrown up and people question.
>> We may have errors like if a directory does not exist, we create it, etc ...
>>
>> Anyway, I would like to hide the task output of plays which I choose
>> because they do not match the when condition, or are skipped, or are
>> superfluous.
>>
>> I don't want to send the whole of ansible-playbook to /dev/null and just
>> have a return code. There are messages that are useful to them.
>>
>> I also don't want to go under the hood and hack with a callback_plugin
>> ... I was hoping there was something out there already.
>>
>> I am trying no_log which prints this sarcastic message:
>>
>> TASK [common : Initial check in] ***************************************
>> ok: [hostA] => {"censored": "the output has been hidden due to the fact
>> that 'no_log: true' was specified for this result"}
>> ok: [hostB] => {"censored": "the output has been hidden due to the fact
>> that 'no_log: true' was specified for this result"}
>> ok: [hostC] => {"censored": "the output has been hidden due to the fact
>> that 'no_log: true' was specified for this result"}
>> ok: [hostD] => {"censored": "the output has been hidden due to the fact
>> that 'no_log: true' was specified for this result"}
>>
>> Hilarious ... Why print a message saying the output has been hidden?
>>
>> Ok seriously how can you just not print this play to the screen AT ALL?
>>
>> central:/app/sysint/bin> ansible --version
>> ansible 2.1.1.0
>>   config file = /etc/ansible/ansible.cfg
>>   configured module search path = Default w/o overrides
>>
>>
>> John
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/e517d943-a1d5-4b8a-b8b0-09f2a63f6291%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/e517d943-a1d5-4b8a-b8b0-09f2a63f6291%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v8M4qHdc0z_GdQYfqOcOm%2BgDMuGm57SDCcs4kLPmzS6RA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to