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
c3ff4ccb
Commit
c3ff4ccb
authored
Jun 01, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
These options to bypass the check code seem to need to occur before said checks.
parent
4a93c247
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
library/system/sysctl
+10
-9
No files found.
library/system/sysctl
View file @
c3ff4ccb
...
...
@@ -48,7 +48,7 @@ options:
description:
- if C(checks)=I(none) no smart/facultative checks will be made
- if C(checks)=I(before) some checks performed before any update (ie. does the sysctl key is writable ?)
- if C(checks)=I(after) some checks performed after an update (ie. does kernel give back the set
ted
value ?)
- if C(checks)=I(after) some checks performed after an update (ie. does kernel give back the set value ?)
- if C(checks)=I(both) all the smart checks I(before and after) are performed
choices: [ "none", "before", "after", "both" ]
default: both
...
...
@@ -139,6 +139,15 @@ def sysctl_args_collapse(**sysctl_args):
# ==============================================================
def
sysctl_check
(
current_step
,
**
sysctl_args
):
# no smart checks at this step ?
if
sysctl_args
[
'checks'
]
==
'none'
:
return
0
,
''
if
current_step
==
'before'
and
sysctl_args
[
'checks'
]
not
in
[
'before'
,
'both'
]:
return
0
,
''
if
current_step
==
'after'
and
sysctl_args
[
'checks'
]
not
in
[
'after'
,
'both'
]:
return
0
,
''
# checking coherence
if
sysctl_args
[
'state'
]
==
'absent'
and
sysctl_args
[
'value'
]
is
not
None
:
return
1
,
'value=x must not be supplied when state=absent'
...
...
@@ -154,14 +163,6 @@ def sysctl_check(current_step, **sysctl_args):
return
1
,
'key_path is not an existing file, key seems invalid'
if
not
os
.
access
(
sysctl_args
[
'key_path'
],
os
.
R_OK
):
return
1
,
'key_path is not a readable file, key seems to be uncheckable'
# no smart checks at this step ?
if
sysctl_args
[
'checks'
]
==
'none'
:
return
0
,
''
if
current_step
==
'before'
and
sysctl_args
[
'checks'
]
not
in
[
'before'
,
'both'
]:
return
0
,
''
if
current_step
==
'after'
and
sysctl_args
[
'checks'
]
not
in
[
'after'
,
'both'
]:
return
0
,
''
# checks before
if
current_step
==
'before'
and
sysctl_args
[
'checks'
]
in
[
'before'
,
'both'
]:
...
...
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