Hi, 

I am very new to puppet and writing my first class :) Please pardon me for 
asking basic question 

I am trying to write module to run install script. Can someone help me with 
syntax or suggest better way to code following 

define install-package {
if ( $env != 'test' or $env != 'qa') {
            case $::package_type {
                'abc': {
                    $variable = '123'
                      }
                'xyz': {
                    $variable = '345'
                      }
   exec {"run_my_script":
          source => "puppet:///modules/mymodule/resources/myinstall
script.sh",
          command => 'sh myscript.sh $variable'
        }
 
             }
else {
            case $::package_type {
                'abc': {
                    $variable = '567'
                      }
                'xyz': {
                    $variable = '789'
                      }
             }
   exec {"run_my_script":
          source => "puppet:///modules/mymodule/resources/myinstall
script.sh",
          command => 'sh myscript.sh $variable'
        }
}

class mymodule::software {
    $package_type = unique([jdk,apache,tomcat])
    install-package { $package_type:; }
}

I am deriving env variable from host name.

Let me know if you need additional details.

Thanks!
--SamirG

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/ecb68180-af56-4d36-a555-236a69efea50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to