From 3539238ec797e63f459e307facdd16e133d52169 Mon Sep 17 00:00:00 2001 From: David Stygstra Date: Wed, 14 Sep 2016 08:32:08 -0400 Subject: [PATCH] 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. --- lib/ansible/modules/extras/system/modprobe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/modprobe.py b/lib/ansible/modules/extras/system/modprobe.py index 94c1a70437b..1bb1d3f70b1 100644 --- a/lib/ansible/modules/extras/system/modprobe.py +++ b/lib/ansible/modules/extras/system/modprobe.py @@ -114,7 +114,7 @@ def main(): args['changed'] = True elif args['state'] == 'absent': 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: module.fail_json(msg=err, **args) args['changed'] = True