How to configure pp file to fetch user password from centralized location on puppet 4?

asked 2016-07-06 06:26:20 -0500

nmurugan06 gravatar image

updated 2016-08-06 13:39:20 -0500

JohnsonEarls gravatar image


user {'user1':
    ensure   => 'present',
    gid      => 'testprog',
   password =>  crypt(get_dat_password('user1',hiera("${site}::${environment}::dat::user1::user1"),hiera("${site}::${environment}::dat::user1::user1_key")),'puppet',$crypt_version),
    home     => '/opt/user1',
    uid      => '30193',

(get_dat_password - is script its working fine). The same setting is working in puppet 3. but its not working in puppet 4. kindly let me know do we need to do any modification on puppet 4.

edit retag flag offensive close merge delete


`get_dat_password` is a custom puppet function? If so, can you invoke it separately for testing? `$pw = get_dat_password('user1',"user1_value","user1_key",'puppet',$crypt_version)` and see if that works? Also, please update the question to include the error message or what "not working" means

JohnsonEarls gravatar imageJohnsonEarls ( 2016-07-07 15:31:22 -0500 )edit

I have separately tested it is working , now I removed $crypt_version It is working. Now other problem escape sequence is not working in hiera value. \ \(BCS\) we used this value for fetching password from common site::development::dat::acts::class: 'test/*/1.0.0/PROD/class\ \(BCS\)

nmurugan06 gravatar imagenmurugan06 ( 2016-07-12 05:35:19 -0500 )edit

@nmurugan06 if this is still an issue, please update the question to include the error message. If the issue is different, please create a new question for the new issue.

JohnsonEarls gravatar imageJohnsonEarls ( 2016-08-06 13:41:03 -0500 )edit