From daa7416323b047abda7d0b78c269ae066797e861 Mon Sep 17 00:00:00 2001 From: Julien DAUPHANT Date: Wed, 5 Mar 2014 16:42:52 +0100 Subject: [PATCH] Add linux module parameters for the modprobe module --- library/system/modprobe | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/library/system/modprobe b/library/system/modprobe index 82ca86b9bd5..1c06142b8eb 100644 --- a/library/system/modprobe +++ b/library/system/modprobe @@ -34,11 +34,18 @@ options: choices: [ present, absent ] description: - Whether the module should be present or absent. + params: + required: false + default: "" + 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 +53,7 @@ def main(): argument_spec={ 'name': {'required': True}, 'state': {'default': 'present', 'choices': ['present', 'absent']}, + 'params': {'default': ''}, }, supports_check_mode=True, ) @@ -54,6 +62,7 @@ def main(): 'failed': False, 'name': module.params['name'], 'state': module.params['state'], + 'params': module.params['params'], } # Check if module is present @@ -81,7 +90,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