From f1f98a15ca87f9746eb52e91210a81af522a5d5e Mon Sep 17 00:00:00 2001 From: Will Keeling Date: Sat, 10 Oct 2015 21:06:10 +0100 Subject: [PATCH] Fixes #634 - multiple param handling by modprobe.py --- lib/ansible/modules/extras/system/modprobe.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/modprobe.py b/lib/ansible/modules/extras/system/modprobe.py index 64e36c784a7..405d5ea22c3 100644 --- a/lib/ansible/modules/extras/system/modprobe.py +++ b/lib/ansible/modules/extras/system/modprobe.py @@ -57,6 +57,9 @@ EXAMPLES = ''' - modprobe: name=dummy state=present params="numdummies=2" ''' +import shlex + + def main(): module = AnsibleModule( argument_spec={ @@ -100,7 +103,9 @@ def main(): # Add/remove module as needed if args['state'] == 'present': if not present: - rc, _, err = module.run_command([module.get_bin_path('modprobe', True), args['name'], args['params']]) + command = [module.get_bin_path('modprobe', True), args['name']] + command.extend(shlex.split(args['params'])) + rc, _, err = module.run_command(command) if rc != 0: module.fail_json(msg=err, **args) args['changed'] = True