summaryrefslogtreecommitdiff
path: root/web_infrastructure
diff options
context:
space:
mode:
authorMichael DeHaan <michael.dehaan@gmail.com>2014-08-08 12:40:13 -0400
committerMichael DeHaan <michael.dehaan@gmail.com>2014-08-08 12:40:13 -0400
commit76eb5064f488c73681147d16e135ed4fe53bf090 (patch)
treeb214b166427e1cbae2b98b05373d35bcd220be71 /web_infrastructure
parente69206741e849ee1a35b08971ab4a26b39629637 (diff)
parent1452a058dfb86834dda631a737a93543ad15c1e3 (diff)
downloadansible-modules-core-76eb5064f488c73681147d16e135ed4fe53bf090.tar.gz
Merge pull request #7520 from jjneely/a2enmod
apache2_module module fixes
Diffstat (limited to 'web_infrastructure')
-rw-r--r--web_infrastructure/apache2_module6
1 files changed, 3 insertions, 3 deletions
diff --git a/web_infrastructure/apache2_module b/web_infrastructure/apache2_module
index 7b71a23c..d966fad5 100644
--- a/web_infrastructure/apache2_module
+++ b/web_infrastructure/apache2_module
@@ -53,7 +53,7 @@ def _disable_module(module):
if re.match(r'.*already disabled.*', stdout):
module.exit_json(changed = False, result = "Success")
- elif result != 0:
+ elif result != 0:
module.fail_json(msg="Failed to disable module %s: %s" % (name, stdout))
else:
module.exit_json(changed = True, result = "Disabled")
@@ -63,9 +63,9 @@ def _enable_module(module):
a2enmod_binary = module.get_bin_path("a2enmod")
result, stdout, stderr = module.run_command("%s %s" % (a2enmod_binary, name))
- if re.match(r'.*already enabled.*', stdout):
+ if re.search(r'.*%s\s+already enabled.*' % name, stdout, re.M):
module.exit_json(changed = False, result = "Success")
- elif result != 0:
+ elif result != 0:
module.fail_json(msg="Failed to enable module %s: %s" % (name, stdout))
else:
module.exit_json(changed = True, result = "Enabled")