Skip to content

Latest commit

 

History

History
343 lines (240 loc) · 9.29 KB

REFERENCE.md

File metadata and controls

343 lines (240 loc) · 9.29 KB

Reference

Table of Contents

Classes

Defined types

Classes

windows_power

class to manage Windows power devices (physical, logical and virtual)

  • See also
    • windows_power::device

Examples

basic usage
class { 'windows_power':
  devices => {
    'HID-compliant mouse (001)' => {
      enable_wake => true
    },
    'wmplayer.exe' => {
      power_request_overrides => {
        process => {
          display  => true,
          awaymode => true
        }
      }
    },
    'Realtek PCIe GbE Family Controller' => {
      enable_wake => false,
      power_request_overrides => {
        driver => {
          display => true,
          system  => true
        }
      }
    }
  }
}

Parameters

The following parameters are available in the windows_power class:

devices

Data type: Optional[Hash[String[1], Hash[Pattern[/^[a-z][a-z0-9_]*$/], Data, 1], 1]]

hash of devices/drivers/services/tools to manage and what/how

Default value: undef

windows_power::hibernate

class to manage Windows hibernate settings

Examples

disable hibernation system wide
class { 'windows_power::hibernate':
  enable => false
}
enable hibernation with default settings
class { 'windows_power::hibernate':
  enable => true
}
enable and configure hibernation
class { 'windows_power::hibernate':
  enable         => true,
  hiberfile_size => 100,
  hiberfile_type => 'full'
}

Parameters

The following parameters are available in the windows_power::hibernate class:

enable

Data type: Boolean

enable/disable the hibernate feature

hiberfile_size

Data type: Optional[Integer[40, 100]]

set desired hiberfile size (percentage of total memory, 40-100)

Default value: undef

hiberfile_type

Data type: Optional[Enum['reduced', 'full']]

set desired hiberfile type (reduced/full)

Default value: undef

windows_power::scheme

class to manage Windows power scheme

Examples

activate the "High performance" system scheme
class { 'windows_power::scheme':
  guid => '8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c'
}
activate the "Balanced" system scheme and set some monitor timeouts
class { 'windows_power::scheme':
  guid     => '381b4222-f694-41f0-9685-ff5bb260df2e',
  settings => {
    monitor-timeout-ac => 30,
    monitor-timeout-dc => 10
  }
}
create a custom template inheriting "High performance" and tweak on that
class { 'windows_power::scheme':
  guid     => 'a1582e9e-9c9d-46fd-afdf-4d989292a073',
  label    => 'really full power',
  template => '8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c',
  settings => {
    disk-timeout-ac      => 0,
    disk-timeout-dc      => 0,
    standby-timeout-ac   => 0,
    standby-timeout-dc   => 0,
    hibernate-timeout-ac => 0,
    hibernate-timeout-dc => 0
  }
}

Parameters

The following parameters are available in the windows_power::scheme class:

guid

Data type: Pattern[/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/]

GUID of the scheme to create/activate; to activate/handle an existing scheme (e.g. the ones provided by the system) don't define a template; to create (and activate and handle) a new scheme (derived from an existing one) define the template.

label

Data type: Optional[String[1]]

desired label/name/title of the scheme (optional, recommended for custom schemes)

Default value: undef

template

Data type: Optional[Pattern[/\A[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\z/]]

GUID of the template scheme to use for creating a new custom scheme (optional); if the template does not exist no action is performed; so it's safe to define a template that will appear later somehow.

Default value: undef

description

Data type: Optional[String[1]]

desired descriptive text of the scheme (optional)

Default value: undef

settings

Data type:

Optional[Hash[Enum[
        'monitor-timeout-ac',
        'monitor-timeout-dc',
        'disk-timeout-ac',
        'disk-timeout-dc',
        'standby-timeout-ac',
        'standby-timeout-dc',
        'hibernate-timeout-ac',
        'hibernate-timeout-dc'
  ], Integer[0], 1, 8]]

settings to change (optional); settings are applied to the active scheme and only if this matches the declared GUID; this way accidential configuration of the wrong scheme is avoided but it might need more than one puppet run to complete all tasks.

Default value: undef

Defined types

windows_power::device

defined type to manage a Windows power device (physical, logical and virtual)

Examples

let your mouse wake the system
windows_power::device { 'HID-compliant mouse (001)':
  enable_wake => true
}
don't allow Windows media player to keep system from turning off the display or from going to away mode
windows_power::device { 'wmplayer.exe':
  power_request_overrides => {
    process => {
      display  => true,
      awaymode => true
    }
  }
}
don't allow your network card to wake the system, keep your display turned on or keep the system active
windows_power::device { 'Realtek PCIe GbE Family Controller':
  enable_wake => false,
  power_request_overrides => {
    driver => {
      display => true,
      system  => true
    }
  }
}
delete all power request overrides for/from vpn service
windows_power::device { 'VPN Service':
  power_request_overrides => {
    service => {
      system  => false
    }
  }
}

Parameters

The following parameters are available in the windows_power::device defined type:

device

Data type: String[1]

name of the device/driver/service/process to handle, defaulting to resource's title (no need to set this manually); also see the shipped fact power_devices! note that the term "device" covers several things (due to the nature of Windows' power management):

  • physical devices build in or connected to the machine (such as a network card or a mouse)
  • logical devices or device groups (such as "HID-compliant system controller" or even "Volume (005)")
  • drivers or driver groups (such as "High Definition Audio Device")
  • services (e.g. your remote management software's service name)
  • processes (e.g. "your_media_player.exe")

Default value: $title

enable_wake

Data type: Optional[Boolean]

allow (or prohibit) the device to wake the system from a sleep state; devices capable of waking the system do have $facts['power_devices'][$device]['wake_programmable'] == true; devices currently allowed waking the system do have $facts['power_devices'][$device]['wake_armed'] == true; it's safe to set enable_wake => true even if the device is not able to do; defined type only activates wake-up functionality if the device is reported to be capable of doing so!

Default value: undef

power_request_overrides

Data type: Optional[Hash[Enum['service', 'process', 'driver'], Hash[Enum['display', 'system', 'awaymode'], Boolean, 1, 3], 1, 3]]

set (or delete) one or more power request overrides for the device (see Microsoft documentation about power requests and overrides); note that not defining a request type is similar to setting it to false but not defining any request type means "don't touch the current state"; so explicitly setting (only) false values makes it possible to delete request overrides set outside of Puppet! see examples for clarity.

Default value: undef