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
509c330f
Commit
509c330f
authored
Mar 28, 2012
by
Christopher Johnston
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for running and started - both will do the same thing
parent
68818ad1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
library/service
+3
-3
No files found.
library/service
View file @
509c330f
...
@@ -44,7 +44,8 @@ for x in items:
...
@@ -44,7 +44,8 @@ for x in items:
name
=
params
[
'name'
]
name
=
params
[
'name'
]
state
=
params
.
get
(
'state'
,
'unknown'
)
state
=
params
.
get
(
'state'
,
'unknown'
)
if
state
not
in
[
'running'
,
'stopped'
,
'restarted'
]:
# running and started are the same
if
state
not
in
[
'running'
,
'started'
,
'stopped'
,
'restarted'
]:
print
"failed=True msg='invalid state'"
print
"failed=True msg='invalid state'"
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
@@ -82,10 +83,9 @@ def _run(cmd):
...
@@ -82,10 +83,9 @@ def _run(cmd):
stdout
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
stderr
=
subprocess
.
PIPE
,
shell
=
True
)
rc
=
0
rc
=
0
if
changed
:
if
changed
:
if
state
==
'started'
:
if
state
in
(
'started'
,
'running'
)
:
rc
=
_run
(
"/sbin/service
%
s start"
%
name
)
rc
=
_run
(
"/sbin/service
%
s start"
%
name
)
elif
state
==
'stopped'
:
elif
state
==
'stopped'
:
rc
=
_run
(
"/sbin/service
%
s stop"
%
name
)
rc
=
_run
(
"/sbin/service
%
s stop"
%
name
)
...
...
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