2017-08-29 20:22:06 +00:00
|
|
|
#!/usr/bin/python
|
2018-02-25 02:09:54 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2017-08-29 20:22:06 +00:00
|
|
|
|
2018-02-25 02:09:54 +00:00
|
|
|
# Copyright: (c) 2017, Ansible Project
|
|
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
2017-08-29 20:22:06 +00:00
|
|
|
|
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
'status': ['preview'],
|
|
|
|
'supported_by': 'community'}
|
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
DOCUMENTATION = r'''
|
2017-08-29 20:22:06 +00:00
|
|
|
---
|
|
|
|
module: win_power_plan
|
|
|
|
short_description: Changes the power plan of a Windows system
|
|
|
|
description:
|
|
|
|
- This module will change the power plan of a Windows system to the defined string.
|
|
|
|
- Windows defaults to C(balanced) which will cause CPU throttling. In some cases it can be preferable
|
|
|
|
to change the mode to C(high performance) to increase CPU performance.
|
|
|
|
version_added: "2.4"
|
|
|
|
options:
|
|
|
|
name:
|
|
|
|
description:
|
2019-01-03 16:50:44 +00:00
|
|
|
- String value that indicates the desired power plan.
|
|
|
|
- The power plan must already be present on the system.
|
|
|
|
- Commonly there will be options for C(balanced) and C(high performance).
|
|
|
|
type: str
|
2018-02-25 02:09:54 +00:00
|
|
|
required: yes
|
2018-12-15 02:23:59 +00:00
|
|
|
author:
|
|
|
|
- Noah Sparks (@nwsparks)
|
2017-08-29 20:22:06 +00:00
|
|
|
'''
|
|
|
|
|
2019-01-03 16:50:44 +00:00
|
|
|
EXAMPLES = r'''
|
2018-02-25 02:09:54 +00:00
|
|
|
- name: Change power plan to high performance
|
2017-08-29 20:22:06 +00:00
|
|
|
win_power_plan:
|
|
|
|
name: high performance
|
|
|
|
'''
|
|
|
|
|
|
|
|
RETURN = r'''
|
|
|
|
power_plan_name:
|
2019-01-03 16:50:44 +00:00
|
|
|
description: Value of the intended power plan.
|
2017-08-29 20:22:06 +00:00
|
|
|
returned: always
|
2018-12-18 21:25:30 +00:00
|
|
|
type: str
|
2017-08-29 20:22:06 +00:00
|
|
|
sample: balanced
|
|
|
|
power_plan_enabled:
|
2019-01-03 16:50:44 +00:00
|
|
|
description: State of the intended power plan.
|
2017-08-29 20:22:06 +00:00
|
|
|
returned: success
|
2018-12-18 21:25:30 +00:00
|
|
|
type: bool
|
2019-01-03 16:50:44 +00:00
|
|
|
sample: true
|
2017-08-29 20:22:06 +00:00
|
|
|
all_available_plans:
|
2019-01-03 16:50:44 +00:00
|
|
|
description: The name and enabled state of all power plans.
|
2017-08-29 20:22:06 +00:00
|
|
|
returned: always
|
2018-12-18 21:25:30 +00:00
|
|
|
type: dict
|
2017-08-29 20:22:06 +00:00
|
|
|
sample: |
|
|
|
|
{
|
|
|
|
"High performance": false,
|
|
|
|
"Balanced": true,
|
|
|
|
"Power saver": false
|
|
|
|
}
|
|
|
|
'''
|