diff --git a/lib/ansible/modules/packaging/os/homebrew_cask.py b/lib/ansible/modules/packaging/os/homebrew_cask.py index 9b885a50316..e835f4ea77b 100644 --- a/lib/ansible/modules/packaging/os/homebrew_cask.py +++ b/lib/ansible/modules/packaging/os/homebrew_cask.py @@ -449,10 +449,10 @@ class HomebrewCask(object): ] rc, out, err = self.module.run_command(cmd) - if re.search(r'Error: Cask .* is not installed.', err): - return False - else: + if rc == 0: return True + else: + return False # /checks ------------------------------------------------------ }}} # commands ----------------------------------------------------- {{{