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
d3b452ec
Commit
d3b452ec
authored
Mar 05, 2014
by
jctanner
Committed by
James Cammarata
Mar 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #5872 from tomdymond/add-ignoreerror-to-sysctl
Add option to enable the sysctl -e option
parent
6221a274
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
library/system/sysctl
+12
-2
No files found.
library/system/sysctl
View file @
d3b452ec
...
...
@@ -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,12 @@ 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
sysctl_args
=
[
self
.
sysctl_cmd
,
'-p'
,
self
.
sysctl_file
]
if
self
.
args
[
'ignoreerrors'
]:
sysctl_args
.
insert
(
1
,
'-e'
)
rc
,
out
,
err
=
self
.
module
.
run_command
(
sysctl_args
)
if
rc
!=
0
:
self
.
module
.
fail_json
(
msg
=
"Failed to reload sysctl:
%
s"
%
str
(
out
)
+
str
(
err
))
...
...
@@ -296,6 +305,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