Ask Your Question

Puppet registry module

asked 2017-05-04 19:06:03 -0500

gangadhar gravatar image


I am trying to manage TightVNC configuration using Registry module.. How I can provide the binary value to the key "password"? I was able set key's which accept the data type of "String"


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-04 19:38:29 -0500

smarlow gravatar image

I'm assuming that you're using the puppetlabs\registry module.

This module supports both managing the key (i.e. making sure that the key exists) and managing the value (making sure that the value in that key is correct).

If you want to just set the value, then you can use the registry_value type:

registry_value { 'path\to\key\password':
  ensure => present,
  type   => 'binary',
  data   => 'the_password',

If you want to manage both the key and the value you can use the registry::value define:

registry::value { 'password':
  key  => 'path\to\key',
  type => 'binary',
  data => 'the_password',
edit flag offensive delete link more


I have understood the class declaration. Does the parameter "data" accepts the value in the form of string? If it only takes "binary" how I can convert the string to binary and provide the value to it. Thanks.

gangadhar gravatar imagegangadhar ( 2017-05-05 10:32:57 -0500 )edit

It looks like REG_BINARY accepts a series of bytes in a hex format. I think that you would have to provide those hex bytes in the data parameter. Converting the string to binary depends on the string format used, which depends on the application which will read it out of the registry.

smarlow gravatar imagesmarlow ( 2017-05-05 10:56:09 -0500 )edit

Thanks Samrlow

gangadhar gravatar imagegangadhar ( 2017-05-08 13:24:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-05-04 19:06:03 -0500

Seen: 29 times

Last updated: May 04