Debian Codegraph @

ansible_collections/community/windows/plugins/modules/win_power_plan.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright: (c) 2017, Ansible Project
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r'''
8 ---
9 module: win_power_plan
10 short_description: Changes the power plan of a Windows system
11 description:
12 - This module will change the power plan of a Windows system to the defined string.
13 - Windows defaults to C(balanced) which will cause CPU throttling. In some cases it can be preferable
14 to change the mode to C(high performance) to increase CPU performance.
15 - One of I(name) or I(guid) must be provided.
16 options:
17 name:
18 description:
19 - String value that indicates the desired power plan by name.
20 - The power plan must already be present on the system.
21 - Commonly there will be options for C(balanced) and C(high performance).
22 type: str
23 required: false
24 guid:
25 description:
26 - String value that indicates the desired power plan by guid.
27 - The power plan must already be present on the system.
28 - For out of box guids see U(https://docs.microsoft.com/en-us/windows/win32/power/power-policy-settings).
29 type: str
30 required: false
31 version_added: 1.9.0
32
33 author:
34 - Noah Sparks (@nwsparks)
35 '''
36
37 EXAMPLES = r'''
38 - name: Change power plan to high performance
39 community.windows.win_power_plan:
40 name: high performance
41
42 - name: Change power plan to high performance
43 community.windows.win_power_plan:
44 guid: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
45 '''
46
47 RETURN = r'''
48 power_plan_name:
49 description: Value of the intended power plan.
50 returned: always
51 type: str
52 sample: balanced
53 power_plan_enabled:
54 description: State of the intended power plan.
55 returned: success
56 type: bool
57 sample: true
58 all_available_plans:
59 description: The name and enabled state of all power plans.
60 returned: always
61 type: dict
62 sample: |
63 {
64 "High performance": false,
65 "Balanced": true,
66 "Power saver": false
67 }
68 '''