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
25f808de
Commit
25f808de
authored
May 15, 2012
by
cocoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add state=reloaded
parent
306bab93
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
library/service
+4
-2
No files found.
library/service
View file @
25f808de
...
...
@@ -120,7 +120,7 @@ list_items = params.get('list', None)
enable
=
params
.
get
(
'enabled'
,
params
.
get
(
'enable'
,
None
))
# running and started are the same
if
state
and
state
.
lower
()
not
in
[
'running'
,
'started'
,
'stopped'
,
'restarted'
]:
if
state
and
state
.
lower
()
not
in
[
'running'
,
'started'
,
'stopped'
,
'restarted'
,
'reloaded'
]:
fail_json
(
dict
(
failed
=
True
,
msg
=
'invalid value for state'
))
if
list_items
and
list_items
.
lower
()
not
in
[
'status'
]:
fail_json
(
dict
(
failed
=
True
,
msg
=
'invalid value for list'
))
...
...
@@ -170,7 +170,7 @@ if state or enable:
if
not
running
and
state
in
(
"started"
,
"running"
):
changed
=
True
elif
running
and
state
==
"stopped"
:
elif
running
and
state
in
(
"stopped"
,
"reloaded"
)
:
changed
=
True
elif
state
==
"restarted"
:
changed
=
True
...
...
@@ -183,6 +183,8 @@ if state or enable:
rc_state
,
stdout
,
stderr
=
_run
(
"
%
s
%
s start"
%
(
SERVICE
,
name
))
elif
state
==
'stopped'
:
rc_state
,
stdout
,
stderr
=
_run
(
"
%
s
%
s stop"
%
(
SERVICE
,
name
))
elif
state
==
'reloaded'
:
rc_state
,
stdout
,
stderr
=
_run
(
"
%
s
%
s reload"
%
(
SERVICE
,
name
))
elif
state
==
'restarted'
:
rc1
,
stdout1
,
stderr1
=
_run
(
"
%
s
%
s stop"
%
(
SERVICE
,
name
))
rc2
,
stdout2
,
stderr2
=
_run
(
"
%
s
%
s start"
%
(
SERVICE
,
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