ansible / ansible.builtin / v2.6.17 / 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.6.17) — module
pip
Install with pip install ansible==2.6.17
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: 'no' 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. exclude_volumes: description: - A list of drive letters or mount point paths to exclude from defragmentation. 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. freespace_consolidation: description: - Perform free space consolidation on the specified volumes.
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: string msg: description: Possible error message on failure returned: failed sample: Command 'defrag.exe' not found in $env:PATH. type: string 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: string stdout: description: The standard output from the command returned: always sample: Success. type: string