Is there a question here? What specifically are you asking for?

On Monday, May 1, 2017 at 6:02:33 PM UTC-6, Samir Gahirwal wrote:
>
> Hi, 
>
> I am new to puppet and writing very first puppet module. Please pardon me 
> for asking basic question. 
>
> I am trying to write a module to generate different types of java 
> keystores in our env.
>
>     define certificate-generator {
>         user => root,
>         group => root,
>         
>         if ( $env != 'test' or $env != 'qa') {
>             case $::target_cert_type {
>                 'type1': {
>                     $password = '123'
>                       }
>                 'type2': {
>                     $password = '345'
>                       }
>                 default: {
>                     fail("No password defined")
>                       }
>             }
>          exec { "certificate-generator":
>               command => 'sh certgen.sh',
>               path    => '/bin/bash',
>               logoutput => true,
>               onlyif =>  "test ! -f ${cert_basedir}/${host}.jks"
>               source => "puppet:///modules/mymodule/certgen/certgen.sh 
> $password"
>               }
>          }
>          else {
>               case $::target_cert_type {
>                 'type1': {
>                     $password = '567'
>                       }
>                 'type2': {
>                     $password = '789'
>                       }
>                 default: {
>                     fail("No password defined ")
>                       }    
>          exec { "certificate-generator":
>               command => 'sh certgen.sh',
>               path    => '/bin/bash',
>               logoutput => true,
>               onlyif =>  "test ! -f ${cert_basedir}/${host}.jks"
>               source => "puppet:///modules/mymodule/certgen/certgen.sh 
> $password"
>               }     
>          }
>
> class javakeystore::certgen{
>     $env = vd_get($::__vd, 'env')
>     $cert_type = vd_get($::__vd, 'certtype')
>     $target_cert_type = unique([$cert_type])
>     certificate-generator { $target_cert_type:; }
> }
>
> We are using verdad 
> <http://verdad.sourceforge.net/verdad-docs-1.0.16/intro.html> for 
> managing host configuration.
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/806c29c9-79e5-49f4-b82d-dbddc0bfe5f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to