puppetlabs-registry icon indicating copy to clipboard operation
puppetlabs-registry copied to clipboard

Path creation for registry key

Open hdep opened this issue 2 years ago • 0 comments

Hello,

I don't know if this is a bug or a feature request, I'll let you choose the proper way :

Use Case

We need to create some registry key on PATH that doesn't exist. Currently if we just use the module like this it will fail. we need to create HKLM\Software\Microsoft\Cryptography\Wintrust\config\EnableCertPaddingCheck but on our system folder Wintrust and config doesn't exist.

Describe the Solution You Would Like

Declare the registry key, and full path get created

  registry_key { 'HKLM\Software\Microsoft\Cryptography\Wintrust\config\EnableCertPaddingCheck':
    ensure => present,
    type   => 'dword',                 # Type de données (par exemple, string, dword, etc.)
    data   => '1',         # Données de la clé
  }

Describe Alternatives You've Considered

We have a workarround :

  registry_key { 'Wintrust':
    path   => 'HKLM\Software\Microsoft\Cryptography\Wintrust', # Crée le chemin parent
    ensure => present,
  }
  registry_key { 'Wintrust2':
    path   => 'HKLM\Software\Microsoft\Cryptography\Wintrust\config', # Crée le chemin parent
    ensure => present,
  }
  registry_value { 'HKLM\Software\Microsoft\Cryptography\Wintrust\config\EnableCertPaddingCheck':
    ensure => present,
    type   => 'dword',                 # Type de données (par exemple, string, dword, etc.)
    data   => '1',         # Données de la clé
  }

at least document this workaround would be a first step.

Additional Context

Add any other context or screenshots about the feature request here.

hdep avatar Oct 20 '23 14:10 hdep