registry_entry_present

Ensure the value of a registry entry is correct.

⚙️ Compatible targets: Windows

Parameters

NameDocumentation
keyRegistry key path (ie, HKLM:\Software\Rudder).

This parameter is required.
entryRegistry entry name.

This parameter is required.
valueRegistry value.

This parameter is required.
registryTypeRegistry value type (String, ExpandString, MultiString, Dword, Qword).

Choices:
  • String
  • ExpandString
  • MultiString
  • Dword

This parameter is required.

Outcome conditions

You need to replace ${entry} with its actual canonified value.

  • ✅ Ok: registry_entry_present_${entry}_ok
    • ☑️ Already compliant: registry_entry_present_${entry}_kept
    • 🟨 Repaired: registry_entry_present_${entry}_repaired
  • ❌ Error: registry_entry_present_${entry}_error

Example

method: registry_entry_present
params:
  value: VALUE
  key: VALUE
  entry: VALUE
  registryType: String

Documentation

If the key and/or its entry does not exist yet, it will be created.

There are two different supported syntaxes to describe a Registry Key:

  • with short drive like HKLM:\SOFTWARE\myKey
  • with long drive name preceded by Registry:: like Registry::HKEY_LOCAL_MACHINE\SOFTWARE\myKey

Please, note that Rudder can not create new drive and new "first-level" Registry Keys.

Examples

- name: Rudder registry "myEntry" property must be set to 1
  method: registry_entry_present
    key: "HKLM:\SOFTWARE\Rudder"
    entry: "myEntry"
    value: "1"
    registryType: "Dword"

- name: Rudder registry "myEntry" property must be set to 1
  method: registry_entry_present
    key: "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Rudder"
    entry: "myEntry"
    value: "1"
    registryType: "Dword"