diff --git a/lib/ansible/modules/packaging/os/homebrew_cask.py b/lib/ansible/modules/packaging/os/homebrew_cask.py index 9b885a5031..e835f4ea77 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 ----------------------------------------------------- {{{