Using get_bin_path to find rmmod and modprobe

pull/18777/head
Robert Osowiecki 10 years ago committed by Matt Clay
parent c90509dc9f
commit 523ba0820b

@ -97,13 +97,13 @@ def main():
# Add/remove module as needed
if args['state'] == '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:
module.fail_json(msg=err, **args)
args['changed'] = True
elif args['state'] == 'absent':
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:
module.fail_json(msg=err, **args)
args['changed'] = True

Loading…
Cancel
Save