I get some meaningless error logs when some commands fail. Do I have an option to print just a message saying Failed?

0 votes
I get some meaningless error logs when some commands fail. Do I have an option to print just a message saying Failed?
Feb 7 in Ansible by Emily
13 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Ansible provides a way to specify this behavior as follows:

- name: Fail task when the command error output prints FAILED
  command: /usr/bin/example-command -x -y -z
  register: command_result
  failed_when: "'FAILED' in command_result.stderr
answered Feb 7 by Pragya

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer

How do I configure a jump host to access servers that I have no direct access to?

You can set a ProxyCommand in the ansible_ssh_common_args inventory variable. Any ...READ MORE

answered Jan 30 in Ansible by Mahir
71 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.