@@ -249,10 +249,14 @@ def partition(predicate, iterable):
249249 # Module is loaded and we don't want it?
250250 if not present and present_mods :
251251 yield 'modprobe{0} -r -a {1}' .format (args , ' ' .join (present_mods ))
252+ for mod in present_mods :
253+ modules .pop (mod )
252254
253255 # Module isn't loaded and we want it?
254256 elif present and missing_mods :
255257 yield 'modprobe{0} -a {1}' .format (args , ' ' .join (missing_mods ))
258+ for mod in missing_mods :
259+ modules [mod ] = {}
256260
257261 else :
258262 host .noop ('{0} {1} {2} {3}' .format (
@@ -299,17 +303,20 @@ def mount(
299303 ' -o {0}' .format (options_string ) if options_string else '' ,
300304 path ,
301305 )
306+ mounts [path ] = {'options' : options }
302307
303308 # Want no mount but mounted?
304309 elif mounted is False and is_mounted :
305310 yield 'umount {0}' .format (path )
311+ mounts .pop (path )
306312
307313 # Want mount and is mounted! Check the options
308314 elif is_mounted and mounted and options :
309315 mounted_options = mounts [path ]['options' ]
310316 needed_options = set (options ) - set (mounted_options )
311317 if needed_options :
312318 yield 'mount -o remount,{0} {1}' .format (options_string , path )
319+ mounts [path ]['options' ] = options
313320
314321 else :
315322 host .noop ('filesystem {0} is {1}' .format (
0 commit comments