|
|
@ -104,6 +104,7 @@ stderr:
|
|
|
|
|
|
|
|
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _run_threaded(module):
|
|
|
|
def _run_threaded(module):
|
|
|
|
control_binary = _get_ctl_binary(module)
|
|
|
|
control_binary = _get_ctl_binary(module)
|
|
|
|
|
|
|
|
|
|
|
@ -111,6 +112,7 @@ def _run_threaded(module):
|
|
|
|
|
|
|
|
|
|
|
|
return bool(re.search(r'threaded:[ ]*yes', stdout))
|
|
|
|
return bool(re.search(r'threaded:[ ]*yes', stdout))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _get_ctl_binary(module):
|
|
|
|
def _get_ctl_binary(module):
|
|
|
|
for command in ['apache2ctl', 'apachectl']:
|
|
|
|
for command in ['apache2ctl', 'apachectl']:
|
|
|
|
ctl_binary = module.get_bin_path(command)
|
|
|
|
ctl_binary = module.get_bin_path(command)
|
|
|
@ -122,6 +124,7 @@ def _get_ctl_binary(module):
|
|
|
|
" At least one apache control binary is necessary."
|
|
|
|
" At least one apache control binary is necessary."
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _module_is_enabled(module):
|
|
|
|
def _module_is_enabled(module):
|
|
|
|
control_binary = _get_ctl_binary(module)
|
|
|
|
control_binary = _get_ctl_binary(module)
|
|
|
|
name = module.params['name']
|
|
|
|
name = module.params['name']
|
|
|
@ -146,6 +149,7 @@ def _module_is_enabled(module):
|
|
|
|
searchstring = ' ' + create_apache_identifier(name)
|
|
|
|
searchstring = ' ' + create_apache_identifier(name)
|
|
|
|
return searchstring in stdout
|
|
|
|
return searchstring in stdout
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_apache_identifier(name):
|
|
|
|
def create_apache_identifier(name):
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
By convention if a module is loaded via name, it appears in apache2ctl -M as
|
|
|
|
By convention if a module is loaded via name, it appears in apache2ctl -M as
|
|
|
@ -215,6 +219,7 @@ def _set_state(module, state):
|
|
|
|
result=success_msg,
|
|
|
|
result=success_msg,
|
|
|
|
warnings=module.warnings)
|
|
|
|
warnings=module.warnings)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
module = AnsibleModule(
|
|
|
|
module = AnsibleModule(
|
|
|
|
argument_spec=dict(
|
|
|
|
argument_spec=dict(
|
|
|
|