registry

This module provides a native type and provider to manage keys and values in the Windows Registry

2,543,764 downloads

6,354 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 5.0.3 (latest)
  • 5.0.2
  • 5.0.1
  • 5.0.0
  • 4.1.2
  • 4.1.1
  • 4.1.0
  • 4.0.1
  • 4.0.0
  • 3.2.0
  • 3.1.1
  • 3.1.0
  • 3.0.0
  • 2.1.0
  • 2.0.2
  • 2.0.1
  • 2.0.0
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1 (deleted)
  • 1.1.0
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Feb 4th 2025
This version is compatible with:
  • Puppet Enterprise 2025.3.x, 2025.2.x, 2025.1.x, 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppetlabs-registry', '5.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-registry
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-registry --version 5.0.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/registry — version 5.0.3 Feb 4th 2025

Reference

Table of Contents

Defined types

  • registry::service: Defined resource type that manages service entries
  • registry::value: High level abstraction on top of registry_key and registry_value resources

Resource types

Defined types

registry::service

Manages the values in the key HKLM\System\CurrentControlSet\Services\$name\

  • Note This defined resource type manages service entries in the Microsoft service control framework by managing the appropriate registry keys and values.

This is an alternative approach to using INSTSRV.EXE [1].

[1] http://support.microsoft.com/kb/137890

Examples

Sample Usage:
registry::service { puppet:
  ensure       => present,
  display_name => 'Puppet Agent',
  description  => 'Periodically fetches and applies
                   configurations from a Puppet Server.',
  command      => 'C:\PuppetLabs\Puppet\service\daemon.bat',
}

Parameters

The following parameters are available in the registry::service defined type:

ensure

Data type: Enum['present', 'absent', 'UNSET']

Ensures the presence or absence of a registry key. Valid values: 'present', 'absent', 'UNSET'.

Default value: 'UNSET'

display_name

Data type: String[1]

The Display Name of the service. Defaults to the title of the resource.

Default value: 'UNSET'

description

Data type: String[1]

A description of the service. String value set to 'UNSET' by default.

Default value: 'UNSET'

command

Data type: String[1]

The command to execute. Set to 'UNSET' by default.

Default value: 'UNSET'

start

Data type: Enum['automatic', 'manual', 'disabled', 'UNSET']

The starting mode of the service. (Note, the native service resource can also be used to manage this setting.) Valid values: 'automatic', 'manual', 'disabled'

Default value: 'UNSET'

registry::value

Actions:

  • Manage the parent key if not already managed.
  • Manage the value

Requires:

  • Registry Module
  • Stdlib Module
  • Note This defined resource type provides a higher level of abstraction on top of the registry_key and registry_value resources. Using this defined resource type, you do not need to explicitly manage the parent key for a particular value. Puppet will automatically manage the parent key for you.

Examples

This example will automatically manage the key. It will also create a value named 'puppetserver' inside this key.
class myapp {
  registry::value { 'puppetserver':
    key => 'HKLM\Software\Vendor\PuppetLabs',
    data => 'puppet.puppetlabs.com',
  }
}

Parameters

The following parameters are available in the registry::value defined type:

key

Data type: Pattern[/^\w+/]

The path of key the value will placed inside.

value

Data type: Optional[String]

The name of the registry value to manage. This will be copied from the resource title if not specified. The special value of '(default)' may be used to manage the default value of the key.

Default value: undef

type

Data type: Pattern[/^\w+/]

The type the registry value. Defaults to 'string'. See the output of puppet describe registry_value for a list of supported types in the "type" parameter.

Default value: 'string'

data

Data type:

Optional[Variant[
      String,
      Numeric,
      Array[String]
  ]]

The data to place inside the registry value.

Default value: undef

Resource types

registry_key

Manages registry keys on Windows

Properties

The following properties are available in the registry_key type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the registry_key type.

path

The path to the registry key to manage

provider

The specific backend to use for this registry_key resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.

purge_values

Valid values: true, false

Common boolean for munging and validation.

Default value: false

registry_value

Manages registry values on Windows systems.

Properties

The following properties are available in the registry_value type.

data

The data stored in the registry value.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

type

Valid values: string, array, dword, qword, binary, expand

The Windows data type of the registry value.

Default value: string

Parameters

The following parameters are available in the registry_value type.

path

The path to the registry value to manage.

provider

The specific backend to use for this registry_value resource. You will seldom need to specify this --- Puppet will usually discover the appropriate provider for your platform.