Note
This plugin is part of the community.windows collection.
To install it use: ansible-galaxy collection install community.windows.
To use it in a playbook, specify: community.windows.win_pagefile.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| automatic boolean |
| Configures AutomaticManagedPagefile for the entire system. |
| drive string | The drive of the pagefile. | |
| initial_size integer | The initial size of the pagefile in megabytes. | |
| maximum_size integer | The maximum size of the pagefile in megabytes. | |
| override boolean |
| Override the current pagefile on the drive. |
| remove_all boolean |
| Remove all pagefiles in the system, not including automatic managed. |
| state string |
| State of the pagefile. |
| system_managed boolean |
| Configures current pagefile to be managed by the system. |
| test_path boolean |
| Use Test-Path on the drive to make sure the drive is accessible before creating the pagefile. |
Note
- 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
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
| automatic_managed_pagefiles boolean | When state is query. | Whether the pagefiles is automatically managed. Sample: True |
| pagefiles list / elements=string | When state is query. | Contains caption, description, initial_size, maximum_size and name for each pagefile in the system. 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'}] |
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.10/collections/community/windows/win_pagefile_module.html