# cat iddmi.pp class iddmi { # define pkg variable $pkg = $hardwareisa ? { "sparc" => "Iddmi_SunOS_sparc.pkg", "i386" => "Iddmi_SunOS_i386.pkg", default => undef, } $ftpsystems = "ftp.example.net/download"
# define path deafult for exec Exec { path => "/usr/bin:/usr/sbin:/bin:/usr/local/bin:/usr/local/sbin", cwd => "/tmp", } case $operatingsystem { "Solaris": { exec { "HP_Disc_Agnt_Prep": command => "wget -O $pkg ftp://$ftpsystems/$pkg; wget -O default ftp://$ftpsystems/default", unless => [ "test -f $pkg", "test -f default" ], before => Exec["HP_Disc_Agnt_Install"], } exec { "HP_Disc_Agnt_Install": command => "pkgadd -a default -d $pkg Iddmi", unless => "pkginfo Iddmi", require => Exec["HP_Disc_Agnt_Prep"], } } default: { } } } include iddmi # puppet -d iddmi.pp debug: Exec[HP_Disc_Agnt_Install]: Adding default for cwd debug: Exec[HP_Disc_Agnt_Install]: Adding default for path debug: Exec[HP_Disc_Agnt_Prep]: Adding default for cwd debug: Exec[HP_Disc_Agnt_Prep]: Adding default for path debug: Creating default schedules debug: Loaded state in 0.62 seconds debug: //iddmi/Exec[HP_Disc_Agnt_Install]/require: requires Exec[HP_Disc_Agnt_Prep] debug: //iddmi/Exec[HP_Disc_Agnt_Prep]/before: requires Exec[HP_Disc_Agnt_Install] debug: Failed to load library 'shadow' for feature 'libshadow' debug: //iddmi/Exec[HP_Disc_Agnt_Prep]: Executing check 'test -f Iddmi_SunOS_sparc.pkg' debug: Executing 'test -f Iddmi_SunOS_sparc.pkg' debug: //iddmi/Exec[HP_Disc_Agnt_Install]: Executing check 'pkginfo Iddmi' debug: Executing 'pkginfo Iddmi' debug: //iddmi/Exec[HP_Disc_Agnt_Install]: Changing returns debug: //iddmi/Exec[HP_Disc_Agnt_Install]: 1 change(s) debug: //iddmi/Exec[HP_Disc_Agnt_Install]: Executing 'pkgadd -a default -d Iddmi_SunOS_sparc.pkg Iddmi' debug: Executing 'pkgadd -a default -d Iddmi_SunOS_sparc.pkg Iddmi' err: //iddmi/Exec[HP_Disc_Agnt_Install]/returns: change from notrun to 0 failed: pkgadd -a default -d Iddmi_SunOS_sparc.pkg Iddmi returned 1 instead of 0 at /opt/home/iqbala/iddmi.pp:26 debug: Finishing transaction 8296656 with 1 changes debug: Storing state debug: Stored state in 4.72 seconds debug: Calling puppetreports.report puppet client is 0.24.7 and puppet server is 2.6.1 -- Asif Iqbal PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.