Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
9a1c1d32
Commit
9a1c1d32
authored
Nov 25, 2013
by
Christian Berendt
Committed by
Michael DeHaan
Mar 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use module.get_bin_path() for a2enmod
parent
b8a8e9fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
library/web_infrastructure/apache2_module
+4
-2
No files found.
library/web_infrastructure/apache2_module
View file @
9a1c1d32
...
@@ -45,7 +45,8 @@ EXAMPLES = '''
...
@@ -45,7 +45,8 @@ EXAMPLES = '''
def
_module_is_enabled
(
module
):
def
_module_is_enabled
(
module
):
name
=
module
.
params
[
'name'
]
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
return
result
==
0
def
_module_is_disabled
(
module
):
def
_module_is_disabled
(
module
):
...
@@ -69,7 +70,8 @@ def _enable_module(module):
...
@@ -69,7 +70,8 @@ def _enable_module(module):
if
_module_is_enabled
(
module
):
if
_module_is_enabled
(
module
):
module
.
exit_json
(
changed
=
False
,
result
=
"Success"
)
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
:
if
result
!=
0
:
module
.
fail_json
(
msg
=
"Failed to enable module
%
s:
%
s"
%
(
name
,
stdout
))
module
.
fail_json
(
msg
=
"Failed to enable module
%
s:
%
s"
%
(
name
,
stdout
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment