diff --git a/lib/ansible/modules/extras/packaging/os/homebrew_tap.py b/lib/ansible/modules/extras/packaging/os/homebrew_tap.py index c6511f0c7b..e871adb356 100644 --- a/lib/ansible/modules/extras/packaging/os/homebrew_tap.py +++ b/lib/ansible/modules/extras/packaging/os/homebrew_tap.py @@ -63,8 +63,11 @@ def already_tapped(module, brew_path, tap): brew_path, 'tap', ]) + taps = [tap_.strip().lower() for tap_ in out.split('\n') if tap_] - return tap.lower() in taps + tap_name = re.sub('homebrew-', '', tap.lower()) + + return tap_name in taps def add_tap(module, brew_path, tap):