From 88dee04f66f26fd5784a82d96fb7b05c4e70893a Mon Sep 17 00:00:00 2001 From: Anatoly Pugachev Date: Sat, 26 Jan 2019 17:28:55 +0300 Subject: [PATCH] Prefer to use gmake (if available) on non linux OS (#51294) * Prefer to use gmake (if available) on non linux OS Fixes #26187 * Small cosmetic changes --- lib/ansible/modules/system/make.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/system/make.py b/lib/ansible/modules/system/make.py index 43ee8b191d9..31f99b353f7 100644 --- a/lib/ansible/modules/system/make.py +++ b/lib/ansible/modules/system/make.py @@ -114,7 +114,11 @@ def main(): ), ) # Build up the invocation of `make` we are going to use - make_path = module.get_bin_path('make', True) + # For non-Linux OSes, prefer gmake (GNU make) over make + make_path = module.get_bin_path('gmake', required=False) + if not make_path: + # Fall back to system make + make_path = module.get_bin_path('make', required=True) make_target = module.params['target'] if module.params['params'] is not None: make_parameters = [k + '=' + str(v) for k, v in iteritems(module.params['params'])]