From aac1ce733397d5cb995592d27cd872685bb6f35b Mon Sep 17 00:00:00 2001 From: newtonne Date: Tue, 25 Sep 2018 12:21:52 +0100 Subject: [PATCH] homebrew_cask: Pass install_options during uninstall (#44938) Until https://github.com/Homebrew/homebrew-cask/issues/40866 is fixed, install_options should be passed when uninstalling casks to ensure that all artefacts are removed. --- lib/ansible/modules/packaging/os/homebrew_cask.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/packaging/os/homebrew_cask.py b/lib/ansible/modules/packaging/os/homebrew_cask.py index 02428cae8f..9b885a5031 100644 --- a/lib/ansible/modules/packaging/os/homebrew_cask.py +++ b/lib/ansible/modules/packaging/os/homebrew_cask.py @@ -651,10 +651,12 @@ class HomebrewCask(object): ) raise HomebrewCaskException(self.message) - cmd = [opt - for opt in (self.brew_path, 'cask', 'uninstall', self.current_cask) - if opt] + opts = ( + [self.brew_path, 'cask', 'uninstall', self.current_cask] + + self.install_options + ) + cmd = [opt for opt in opts if opt] rc, out, err = self.module.run_command(cmd) if not self._current_cask_is_installed():