Created
March 5, 2018 16:54
-
-
Save skamithi/66afd156bf2463c5987468e18f4d6bbc to your computer and use it in GitHub Desktop.
test123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
connection: local | |
tasks: | |
- name: run a shell command | |
shell: cat /tmp/123 | |
register: shell_output | |
# failed_when: false # do not print out json blob if it fails | |
ignore_errors: yes # print out json blob with error message | |
changed_when: false | |
- name: print out the message if its a standard error | |
debug: | |
msg: "Error message is {{ shell_output.stderr }}" | |
when: shell_output.rc != 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment