Created
July 4, 2018 11:50
-
-
Save obourdon/cce2b874845b1c922e50a653afb2fa77 to your computer and use it in GitHub Desktop.
Ansible command check
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
- name: "Check command" | |
command: | | |
my-cmd | |
my-params | |
... | |
register: test_command | |
failed_when: "test_command.rc == 2 and test_command.msg is match('.* No such file or directory')" | |
ignore_errors: true | |
environment: "{{ my_venv if enable_venv else {} }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment