GithubHelp home page GithubHelp logo

voxpupuli / puppet-windows_power Goto Github PK

View Code? Open in Web Editor NEW
4.0 37.0 11.0 194 KB

Home Page: https://forge.puppet.com/puppet/windows_power

License: Apache License 2.0

Ruby 57.48% Puppet 40.60% Dockerfile 1.92%
puppet windows-puppet-module hacktoberfest

puppet-windows_power's Introduction

puppet-windows_power

Table of Contents

  1. Overview
  2. Module Description - What is the windows_power module?
  3. Setup - The basics of getting started with windows_power
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

Puppet module for managing windows power settings

Build Status

Module Description

The purpose of this module is to manage each of the windows power schemes and the various global power settings

Setup

What windows_power affects

  • Creates new power schemes (which will alter registry settings)

Beginning with windows_power

Create new power scheme:

windows_power::schemes::scheme { 'test scheme':
  scheme_name     => 'test',
  scheme_guid     => '381b4222-f694-41f0-9685-ff5bbxx65ddx',
  template_scheme => '381b4222-f694-41f0-9685-ff5bb260df2e',
  activation      => 'active',
  ensure          => 'present',
}

Set monitor timeout in 'Balanced' power scheme to 10 minutes:

windows_power::schemes::settings { 'set monitor timeout':
  scheme_name => 'SCHEME_BALANCED',
  setting     => 'monitor-timeout-ac',
  value       => '10',
}

Usage

Classes and Defined Types:

Defined Type: windows_power::schemes::scheme

Parameters within windows_power::schemes::scheme:

scheme_name

The name of the scheme to configure

scheme_guid

The windows guid used to uniquely identify the power scheme

template_scheme

The windows guid of an existing scheme to be used as a template for the current scheme

activation

Set the current scheme as the active scheme

ensure

Configure if the scheme is present or absent The initial version

Defined Type: windows_power::schemes::settings

Parameters within windows_power::schemes::settings:

scheme_name

The name of the scheme to configure

setting

The setting to configure

value

The value set the setting to - minutes or throttle

Defined Type: windows_power::global::battery

Parameters within windows_power::global::battery:

setting

Battery alarm setting to The initial versionconfigure

status

Setting configuration (on/off) or percentage (in the case of the level setting)

criticality

The level of battery criticality at which to provide an alarm. LOW or HIGH.

Defined Type: windows_power::global::flags

Parameters within windows_power::global::flags:

setting

The global power flag to configure

status

Setting configuration (on/off)

Defined Type: windows_power::global::hiberation

Parameters within windows_power::global::hibernation:

status

Setting configuration (on/off)

Defined Type: windows_power::devices::override

Parameters within windows_power::devices::override:

type

Specifies one of the following caller types: PROCESS, SERVICE, DRIVER

request

Specifies one or more of the following Power Request Types: Display, System, Awaymode

Defined Type: windows_power::devices::wake

Parameters within windows_power::devices::wake:

device

Specifies the device name

ensure

Enable or disable the device for waking

Reference

Defined Types:

Public Defined Types:

Limitations

This module is tested on the following platforms:

  • Windows 2008 R2

It is tested with the OSS version of Puppet only.

Development

Contributing

Please read CONTRIBUTING.md for full details on contributing to this project.

puppet-windows_power's People

Contributors

alexjfisher avatar bastelfreak avatar bbriggs avatar dhoppe avatar ekohl avatar fraenki avatar igalic avatar juniorsysadmin avatar liamjbennett avatar lightning- avatar llowder avatar maxadamo avatar natemccurdy avatar nekototori avatar sandra-thieme avatar smortex avatar thoscut avatar tragiccode avatar vinzent avatar wyardley avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-windows_power's Issues

Settings can only be changed for the currently active scheme

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.12
  • Ruby:
  • Distribution: Windows 10 Pro
  • Module version: HEAD

How to reproduce (e.g Puppet code you use)

I'm using this configuration:

    windows_power::schemes::scheme { 'test scheme':
       scheme_name     => 'test',
       scheme_guid     => 'ed4e499e-903d-4f5f-bec5-b853982e1ec4',
       template_scheme => '381b4222-f694-41f0-9685-ff5bb260df2e',
       activation      => 'inactive',
       ensure          => 'present',
    }

    windows_power::schemes::settings { 'set monitor sleep timeout on ac power':
      setting => 'monitor-timeout-ac',
      value   => '66',
      scheme_name => 'test'
    }

Please note that the scheme is configured to be inactive and I want to change a setting for this inactive scheme.

What are you seeing

The setting monitor-timeout-ac is configured for the currently active scheme. The setting is NOT changed for the scheme "test".

What behaviour did you expect instead

The setting monitor-timeout-ac should be configured for the scheme "test".

Output log

Any additional information you'd like to impart

The module documentation states that...

windows_power::schemes::settings: Configures individual settings with a given scheme.

...but this is not true. According to the official documentation it behaves otherwise:

/change, /X Modifies a setting value in the current power scheme.

It looks like the feature that this modules promotes is not possible. So my suggestion is:

  • First check if the specified scheme is actually enabled before changing any setting (using /getactivescheme)
  • If the specified scheme is NOT active, just print a WARNING and do NOT change settings for the wrong scheme

I'd submit a PR if this change is accepted by the authors/maintainers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.