i have 100 machines and first need to query the page file and if it is less than 8192 only then below code should work. but it overrides all.
name: Query C pagefile
community.windows.win_pagefile:
drive: C
register: pagefile_size
name: Set C pagefile, if size is less than 8192
community.windows.win_pagefile:
drive: C
initial_size: 8192
maximum_size:8192
state: present
when: pagefile_size | int < 8192
name: Query C pagefile
win_pagefile:
drive: C
register: pagefile_size
name: Set C pagefile, if size is less than 8192
win_pagefile:
drive: C
initial_size: 8192
maximum_size:8192
state: present
when: pagefile_size.pagefiles[0].maximum_size | int < 8192
reason as my output under register:pagefile_size was of type dictionary
i have 100 machines and first need to query the page file and if it is less than 8192 only then below code should work. but it overrides all.