From 9a1c1d3242899147775bbb83fb182bd301bdb06b Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Mon, 25 Nov 2013 12:50:22 +0100 Subject: [PATCH] use module.get_bin_path() for a2enmod --- library/web_infrastructure/apache2_module | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/web_infrastructure/apache2_module b/library/web_infrastructure/apache2_module index 864d95e755..94e33adcbb 100644 --- a/library/web_infrastructure/apache2_module +++ b/library/web_infrastructure/apache2_module @@ -45,7 +45,8 @@ EXAMPLES = ''' def _module_is_enabled(module): name = module.params['name'] - result, stdout, stderr = module.run_command("a2enmod -q %s" % name) + a2enmod_binary = module.get_bin_path("a2enmod") + result, stdout, stderr = module.run_command("%s -q %s" % (a2enmod_binary, name)) return result == 0 def _module_is_disabled(module): @@ -69,7 +70,8 @@ def _enable_module(module): if _module_is_enabled(module): module.exit_json(changed = False, result = "Success") - result, stdout, stderr = module.run_command("a2enmod %s" % name) + a2enmod_binary = module.get_bin_path("a2enmod") + result, stdout, stderr = module.run_command("%s %s" % (a2enmod_binary, name)) if result != 0: module.fail_json(msg="Failed to enable module %s: %s" % (name, stdout))