win_pagefile – Query or change pagefile configuration¶
New in version 2.4.
Synopsis¶
- Query current pagefile configuration.
- Enable/Disable AutomaticManagedPagefile.
- Create new or override pagefile configuration.
Parameters¶
Notes¶
Note
- There is difference between automatic managed pagefiles that configured once for the entire system and system managed pagefile that configured per pagefile.
- InitialSize 0 and MaximumSize 0 means the pagefile is managed by the system.
- Value out of range exception may be caused by several different issues, two common problems - No such drive, Pagefile size is too small.
- Setting a pagefile when AutomaticManagedPagefile is on will disable the AutomaticManagedPagefile.
Examples¶
- name: Query pagefiles configuration
  win_pagefile:
- name: Query C pagefile
  win_pagefile:
    drive: C
- name: Set C pagefile, don't override if exists
  win_pagefile:
    drive: C
    initial_size: 1024
    maximum_size: 1024
    override: no
    state: present
- name: Set C pagefile, override if exists
  win_pagefile:
    drive: C
    initial_size: 1024
    maximum_size: 1024
    state: present
- name: Remove C pagefile
  win_pagefile:
    drive: C
    state: absent
- name: Remove all current pagefiles, enable AutomaticManagedPagefile and query at the end
  win_pagefile:
    remove_all: yes
    automatic: yes
- name: Remove all pagefiles disable AutomaticManagedPagefile and set C pagefile
  win_pagefile:
    drive: C
    initial_size: 2048
    maximum_size: 2048
    remove_all: yes
    automatic: no
    state: present
- name: Set D pagefile, override if exists
  win_pagefile:
    drive: d
    initial_size: 1024
    maximum_size: 1024
    state: present
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Liran Nisanov (@LiranNis)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
