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
be5386f9
Commit
be5386f9
authored
Jun 30, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote branch 'origin' into devel
parents
8b592c9d
2bbad5da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
lib/ansible/inventory/__init__.py
+5
-0
library/system/service
+22
-3
No files found.
lib/ansible/inventory/__init__.py
View file @
be5386f9
...
...
@@ -136,6 +136,11 @@ class Inventory(object):
finds hosts that match a list of patterns. Handles negative
matches as well as intersection matches.
"""
try
:
if
patterns
[
0
]
.
startswith
(
"!"
):
patterns
.
insert
(
0
,
"all"
)
except
IndexError
:
pass
hosts
=
set
()
for
p
in
patterns
:
...
...
library/system/service
View file @
be5386f9
...
...
@@ -547,6 +547,27 @@ class LinuxService(Service):
if
not
self
.
enable
:
return
if
self
.
enable_cmd
.
endswith
(
"update-rc.d"
):
if
self
.
enable
:
action
=
'enable'
else
:
action
=
'disable'
(
rc
,
out
,
err
)
=
self
.
execute_command
(
"
%
s -n
%
s
%
s"
\
%
(
self
.
enable_cmd
,
self
.
name
,
action
))
self
.
changed
=
False
for
line
in
out
.
splitlines
():
if
line
.
startswith
(
'rename'
):
self
.
changed
=
True
break
if
self
.
module
.
check_mode
:
self
.
module
.
exit_json
(
changed
=
changed
)
if
not
self
.
changed
:
return
return
self
.
execute_command
(
"
%
s
%
s
%
s"
%
(
self
.
enable_cmd
,
self
.
name
,
action
))
# we change argument depending on real binary used:
# - update-rc.d and systemctl wants enable/disable
# - chkconfig wants on/off
...
...
@@ -561,9 +582,7 @@ class LinuxService(Service):
enable_disable
=
"disable"
add_delete
=
"delete"
if
self
.
enable_cmd
.
endswith
(
"update-rc.d"
):
args
=
(
self
.
enable_cmd
,
self
.
name
,
enable_disable
)
elif
self
.
enable_cmd
.
endswith
(
"rc-update"
):
if
self
.
enable_cmd
.
endswith
(
"rc-update"
):
args
=
(
self
.
enable_cmd
,
add_delete
,
self
.
name
+
" "
+
self
.
runlevel
)
elif
self
.
enable_cmd
.
endswith
(
"systemctl"
):
args
=
(
self
.
enable_cmd
,
enable_disable
,
self
.
name
+
".service"
)
...
...
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