Use `modprobe -r` instead of `rmmod` in modprobe module (#2669)

If any modules that the module being removed depends on are unused, they
will also be removed. Fixes #2140.
reviewable/pr18780/r1
David Stygstra 8 years ago committed by René Moser
parent d69a6f20da
commit 333133144e

@ -114,7 +114,7 @@ def main():
args['changed'] = True args['changed'] = True
elif args['state'] == 'absent': elif args['state'] == 'absent':
if present: if present:
rc, _, err = module.run_command([module.get_bin_path('rmmod', True), args['name']]) rc, _, err = module.run_command([module.get_bin_path('modprobe', True), '-r', 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

Loading…
Cancel
Save