|
|
@ -97,13 +97,13 @@ def main():
|
|
|
|
# Add/remove module as needed
|
|
|
|
# Add/remove module as needed
|
|
|
|
if args['state'] == 'present':
|
|
|
|
if args['state'] == 'present':
|
|
|
|
if not present:
|
|
|
|
if not present:
|
|
|
|
rc, _, err = module.run_command(['modprobe', args['name'], args['params']])
|
|
|
|
rc, _, err = module.run_command([module.get_bin_path('modprobe', True), args['name'], args['params']])
|
|
|
|
if rc != 0:
|
|
|
|
if rc != 0:
|
|
|
|
module.fail_json(msg=err, **args)
|
|
|
|
module.fail_json(msg=err, **args)
|
|
|
|
args['changed'] = True
|
|
|
|
args['changed'] = True
|
|
|
|
elif args['state'] == 'absent':
|
|
|
|
elif args['state'] == 'absent':
|
|
|
|
if present:
|
|
|
|
if present:
|
|
|
|
rc, _, err = module.run_command(['rmmod', args['name']])
|
|
|
|
rc, _, err = module.run_command([module.get_bin_path('rmmod', True), args['name']])
|
|
|
|
if rc != 0:
|
|
|
|
if rc != 0:
|
|
|
|
module.fail_json(msg=err, **args)
|
|
|
|
module.fail_json(msg=err, **args)
|
|
|
|
args['changed'] = True
|
|
|
|
args['changed'] = True
|
|
|
|