community / community.windows / 2.2.0 / module / win_pagefile Query or change pagefile configuration Authors: Liran Nisanov (@LiranNis)community.windows.win_pagefile (2.2.0) — module
Install with ansible-galaxy collection install community.windows:==2.2.0
collections: - name: community.windows version: 2.2.0
Query current pagefile configuration.
Enable/Disable AutomaticManagedPagefile.
Create new or override pagefile configuration.
- name: Query pagefiles configuration community.windows.win_pagefile:
- name: Query C pagefile community.windows.win_pagefile: drive: C
- name: Set C pagefile, don't override if exists community.windows.win_pagefile: drive: C initial_size: 1024 maximum_size: 1024 override: no state: present
- name: Set C pagefile, override if exists community.windows.win_pagefile: drive: C initial_size: 1024 maximum_size: 1024 state: present
- name: Remove C pagefile community.windows.win_pagefile: drive: C state: absent
- name: Remove all current pagefiles, enable AutomaticManagedPagefile and query at the end community.windows.win_pagefile: remove_all: yes automatic: yes
- name: Remove all pagefiles disable AutomaticManagedPagefile and set C pagefile community.windows.win_pagefile: drive: C initial_size: 2048 maximum_size: 2048 remove_all: yes automatic: no state: present
- name: Set D pagefile, override if exists community.windows.win_pagefile: drive: d initial_size: 1024 maximum_size: 1024 state: present
drive: description: - The drive of the pagefile. type: str state: choices: - absent - present - query default: query description: - State of the pagefile. type: str override: default: true description: - Override the current pagefile on the drive. type: bool automatic: description: - Configures AutomaticManagedPagefile for the entire system. type: bool test_path: default: true description: - Use Test-Path on the drive to make sure the drive is accessible before creating the pagefile. type: bool remove_all: default: false description: - Remove all pagefiles in the system, not including automatic managed. type: bool initial_size: description: - The initial size of the pagefile in megabytes. type: int maximum_size: description: - The maximum size of the pagefile in megabytes. type: int system_managed: default: false description: - Configures current pagefile to be managed by the system. type: bool
automatic_managed_pagefiles: description: Whether the pagefiles is automatically managed. returned: When state is query. sample: true type: bool pagefiles: description: Contains caption, description, initial_size, maximum_size and name for each pagefile in the system. returned: When state is query. sample: - caption: c:\ 'pagefile.sys' description: '''pagefile.sys'' @ c:\' initial_size: 2048 maximum_size: 2048 name: c:\pagefile.sys - caption: d:\ 'pagefile.sys' description: '''pagefile.sys'' @ d:\' initial_size: 1024 maximum_size: 1024 name: d:\pagefile.sys type: list