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/da161ae2-a30c-4ff1-8815-e2db081130c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to