On Fri, 21 Jul 2017 16:34:53 +0200
Frank Thommen <[email protected]> wrote:

> Hi,
> 
> I have a playbook which executes a local task from which I need the
> exit status in later steps:
> 
> 
>    - name: Get exit status of ./run.sh
>      local_action:  command ./run.sh
>      register:      ES
>      ignore_errors: yes
> 
>    - name: Do something if ./run.sh failed
>      command:
>       ....
>      when: ES.rc == 1
> 
> 
> Unfortunately when "./run.sh" fails, ansible prints a whole bunch of 
> diagnostic output to the screen, which I am not interested in.
> 
> How can I tell ansible *not* to print diagnostic error output of a 
> specific step?
> 
> We are running ansible 2.3.0 0 on CentOS 7
> 
> Cheers
> frank

You could use "failed_when: False" on the task. Although, keep in mind
that would make the task treated as successful for all other purposes
(e.g. ES.failed would be set to False).

Best regards

-- 
Branko Majic
XMPP: [email protected]
Please use only Free formats when sending attachments to me.

Бранко Мајић
XMPP: [email protected]
Молим вас да додатке шаљете искључиво у слободним форматима.

-- 
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/20170721171736.6d65ef1f%40majic.rs.
For more options, visit https://groups.google.com/d/optout.

Reply via email to