1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cowsay for BSD!

Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
This commit is contained in:
Brian Coca 2012-10-06 15:25:37 -04:00
parent 036f853d42
commit e98153d26d

View file

@ -28,15 +28,16 @@ callbacks = utils.import_plugins(os.path.join(dirname, 'callback_plugins'))
callbacks = [ c.CallbackModule() for c in callbacks.values() ] callbacks = [ c.CallbackModule() for c in callbacks.values() ]
cowsay = None cowsay = None
if os.path.exists("/usr/bin/cowsay"):
cowsay = "/usr/bin/cowsay"
elif os.path.exists("/usr/games/cowsay"):
cowsay = "/usr/games/cowsay"
if os.getenv("ANSIBLE_NOCOWS") is not None: if os.getenv("ANSIBLE_NOCOWS") is not None:
cowsay = None cowsay = None
elif os.path.exists("/usr/games/cowsay"):
cowsay = "/usr/games/cowsay"
elif os.path.exists("/usr/local/bin/cowsay"):
# BSD path for cowsay
cowsay = "/usr/local/bin/cowsay"
def call_callback_module(method_name, *args, **kwargs): def call_callback_module(method_name, *args, **kwargs):
for callback_plugin in callbacks: for callback_plugin in callbacks:
methods = [ methods = [
getattr(callback_plugin, method_name, None), getattr(callback_plugin, method_name, None),