summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn0trax <github@n0trax.io>2017-01-17 10:20:32 +0100
committerjctanner <tanner.jc@gmail.com>2017-01-26 12:26:59 -0500
commit42e63d429c63e078e406d95edebd8f86cd44cfbd (patch)
tree26a94a374d133015c91d8249b376c50818f08f58
parent392fa5a7ac78b1b26d438319113f0da0ad7a6b7a (diff)
downloadansible-42e63d429c63e078e406d95edebd8f86cd44cfbd.tar.gz
Add workaround for shib2 and php modules
-rw-r--r--lib/ansible/modules/web_infrastructure/apache2_module.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/ansible/modules/web_infrastructure/apache2_module.py b/lib/ansible/modules/web_infrastructure/apache2_module.py
index c8a0b95bc5..6e2519b688 100644
--- a/lib/ansible/modules/web_infrastructure/apache2_module.py
+++ b/lib/ansible/modules/web_infrastructure/apache2_module.py
@@ -131,12 +131,6 @@ def _module_is_enabled(module):
result, stdout, stderr = module.run_command("%s -M" % control_binary)
- """
- Work around for Ubuntu Xenial listing php7_module as php7.0
- """
- if name == "php7.0":
- name = "php7"
-
if result != 0:
error_msg = "Error executing %s: %s" % (control_binary, stderr)
if ignore_configcheck:
@@ -151,6 +145,19 @@ def _module_is_enabled(module):
else:
module.fail_json(msg=error_msg)
+ """
+ Work around for php modules; php7.x are always listed as php7_module
+ """
+ php_module = re.search(r'^(php\d)\.', name)
+ if php_module:
+ name = php_module.group(1)
+
+ """
+ Workaround for shib2; module is listed as mod_shib
+ """
+ if re.search(r'shib2', name):
+ return bool(re.search(r' mod_shib', stdout))
+
return bool(re.search(r' ' + name + r'_module', stdout))
def _set_state(module, state):