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
cf80f9b6
Commit
cf80f9b6
authored
Feb 04, 2014
by
Tom Dymond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to enable the sysctl -e option
parent
e0429a40
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
library/system/sysctl
+11
-2
No files found.
library/system/sysctl
View file @
cf80f9b6
...
...
@@ -45,6 +45,11 @@ options:
- Whether the entry should be present or absent in the sysctl file.
choices: [ "present", "absent" ]
default: present
ignoreerrors:
description:
- Use this option to ignore errors about unknown keys.
choices: [ "yes", "no" ]
default: no
reload:
description:
- If C(yes), performs a I(/sbin/sysctl -p) if the C(sysctl_file) is
...
...
@@ -214,8 +219,11 @@ class SysctlModule(object):
# freebsd doesn't support -p, so reload the sysctl service
rc
,
out
,
err
=
self
.
module
.
run_command
(
'/etc/rc.d/sysctl reload'
)
else
:
# system supports reloading via the -p flag to sysctl, so we'll use that
rc
,
out
,
err
=
self
.
module
.
run_command
([
self
.
sysctl_cmd
,
'-p'
,
self
.
sysctl_file
])
# system supports reloading via the -p flag to sysctl, so we'll use that
if
self
.
args
[
'ignoreerrors'
]:
rc
,
out
,
err
=
self
.
module
.
run_command
([
self
.
sysctl_cmd
,
'-e'
,
'-p'
,
self
.
sysctl_file
])
else
:
rc
,
out
,
err
=
self
.
module
.
run_command
([
self
.
sysctl_cmd
,
'-p'
,
self
.
sysctl_file
])
if
rc
!=
0
:
self
.
module
.
fail_json
(
msg
=
"Failed to reload sysctl:
%
s"
%
str
(
out
)
+
str
(
err
))
...
...
@@ -296,6 +304,7 @@ def main():
state
=
dict
(
default
=
'present'
,
choices
=
[
'present'
,
'absent'
]),
reload
=
dict
(
default
=
True
,
type
=
'bool'
),
sysctl_set
=
dict
(
default
=
False
,
type
=
'bool'
),
ignoreerrors
=
dict
(
default
=
False
,
type
=
'bool'
),
sysctl_file
=
dict
(
default
=
'/etc/sysctl.conf'
)
),
supports_check_mode
=
True
...
...
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