ansible / ansible.builtin / v2.9.27 / module / win_defrag Consolidate fragmented files on local volumes | "added in version" 2.4 of ansible.builtin" Authors: Dag Wieers (@dagwieers) preview | supported by communityansible.builtin.win_defrag (v2.9.27) — module
pip
Install with pip install ansible==2.9.27
Locates and consolidates fragmented files on local volumes to improve system performance.
More information regarding C(win_defrag) is available from: U(https://technet.microsoft.com/en-us/library/cc731650(v=ws.11).aspx)
- name: Defragment all local volumes (in parallel) win_defrag: parallel: yes
- name: 'Defragment all local volumes, except C: and D:' win_defrag: exclude_volumes: [ C, D ]
- name: 'Defragment volume D: with normal priority' win_defrag: include_volumes: D priority: normal
- name: Consolidate free space (useful when reducing volumes) win_defrag: freespace_consolidation: yes
parallel: default: false description: - Run the operation on each volume in parallel in the background. type: bool priority: choices: - low - normal default: low description: - Run the operation at low or normal priority. type: str exclude_volumes: description: - A list of drive letters or mount point paths to exclude from defragmentation. type: list include_volumes: description: - A list of drive letters or mount point paths of the volumes to be defragmented. - If this parameter is omitted, all volumes (not excluded) will be fragmented. type: list freespace_consolidation: default: false description: - Perform free space consolidation on the specified volumes. type: bool
changed: description: Whether or not any changes were made. returned: always sample: true type: bool cmd: description: The complete command line used by the module. returned: always sample: defrag.exe /C /V type: str msg: description: Possible error message on failure. returned: failed sample: Command 'defrag.exe' not found in $env:PATH. type: str rc: description: The return code for the command. returned: always sample: 0 type: int stderr: description: The error output from the command. returned: always sample: null type: str stdout: description: The standard output from the command. returned: always sample: Success. type: str