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
3b285d73
Commit
3b285d73
authored
Mar 27, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6296 from jdauphant/devel
Add linux module parameters for the modprobe module
parents
9921f804
16bb6c88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
+11
-1
library/system/modprobe
+11
-1
No files found.
library/system/modprobe
View file @
3b285d73
...
...
@@ -34,11 +34,19 @@ options:
choices: [ present, absent ]
description:
- Whether the module should be present or absent.
params:
required: false
default: ""
version_added: "1.6"
description:
- Modules parameters.
'''
EXAMPLES
=
'''
# Add the 802.1q module
- modprobe: name=8021q state=present
# Add the dummy module
- modprobe: name=dummy state=present params="numdummies=2"
'''
def
main
():
...
...
@@ -46,6 +54,7 @@ def main():
argument_spec
=
{
'name'
:
{
'required'
:
True
},
'state'
:
{
'default'
:
'present'
,
'choices'
:
[
'present'
,
'absent'
]},
'params'
:
{
'default'
:
''
},
},
supports_check_mode
=
True
,
)
...
...
@@ -54,6 +63,7 @@ def main():
'failed'
:
False
,
'name'
:
module
.
params
[
'name'
],
'state'
:
module
.
params
[
'state'
],
'params'
:
module
.
params
[
'params'
],
}
# Check if module is present
...
...
@@ -82,7 +92,7 @@ def main():
# Add/remove module as needed
if
args
[
'state'
]
==
'present'
:
if
not
present
:
rc
,
_
,
err
=
module
.
run_command
([
'modprobe'
,
args
[
'name'
]])
rc
,
_
,
err
=
module
.
run_command
([
'modprobe'
,
args
[
'name'
]
,
args
[
'params'
]
])
if
rc
!=
0
:
module
.
fail_json
(
msg
=
err
,
**
args
)
args
[
'changed'
]
=
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