diff --git a/changelogs/fragments/1411_homebrew_tap.yml b/changelogs/fragments/1411_homebrew_tap.yml new file mode 100644 index 0000000000..acbd4d0c9d --- /dev/null +++ b/changelogs/fragments/1411_homebrew_tap.yml @@ -0,0 +1,2 @@ +minor_changes: +- homebrew_tap - provide error message to user when module fails (https://github.com/ansible-collections/community.general/issues/1411). diff --git a/plugins/modules/packaging/os/homebrew_tap.py b/plugins/modules/packaging/os/homebrew_tap.py index 3fbf6b3394..4797f80422 100644 --- a/plugins/modules/packaging/os/homebrew_tap.py +++ b/plugins/modules/packaging/os/homebrew_tap.py @@ -1,8 +1,8 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -# (c) 2013, Daniel Jaouen -# (c) 2016, Indrajit Raychaudhuri +# Copyright: (c) 2013, Daniel Jaouen +# Copyright: (c) 2016, Indrajit Raychaudhuri # # Based on homebrew (Andrew Dunham ) # @@ -12,7 +12,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -DOCUMENTATION = ''' +DOCUMENTATION = r''' --- module: homebrew_tap author: @@ -48,7 +48,7 @@ options: requirements: [ homebrew ] ''' -EXAMPLES = ''' +EXAMPLES = r''' - name: Tap a Homebrew repository, state present community.general.homebrew_tap: name: homebrew/dupes @@ -117,7 +117,7 @@ def add_tap(module, brew_path, tap, url=None): msg = 'successfully tapped: %s' % tap else: failed = True - msg = 'failed to tap: %s' % tap + msg = 'failed to tap: %s due to %s' % (tap, err) else: msg = 'already tapped: %s' % tap @@ -172,7 +172,7 @@ def remove_tap(module, brew_path, tap): msg = 'successfully untapped: %s' % tap else: failed = True - msg = 'failed to untap: %s' % tap + msg = 'failed to untap: %s due to %s' % (tap, err) else: msg = 'already untapped: %s' % tap