On Sun, 7 Apr 2013 02:16:07 -0700 (PDT)
[email protected] wrote:

> Thanks for all the information Stefan!
> I'd be happy to see the module you're using if it's possible.
> 
> Roee.
> 

Ok so I have a hpoml::client class to include at node level. It
basically consists of a hpoml::user class where I define the `opc_op`
User and the `opcgrp` group (to have consistent uid and gid across
machines) and the class hpoml::client::package. I guess I can share
that one:

class hpoml::client::package ($server = 'your_master_server', $minversion = 
'11.11.025') {

  if ! ($::operatingsystem in [ 'Solaris', 'RedHat' ]) {
    fail "operatingsystem ${::operatingsystem} is currently not supported. Must 
be one of Solaris, RedHat"
  }

  $installer = '/some/nas/share/Agt_11.11.x/oainstall.sh'
  $install_arguments = '-install -agent -includeupdates -defer_configure'
  $update_arguments = '-install -agent -includeupdates'

  exec { 'Install_OML':
    command  => "${installer} ${install_arguments}",
    creates  => [
      '/opt/OV/bin/ovc',
      '/opt/OV/bin/ovconfget',
    ],
    timeout  => '1800',  # 30 minutes
  }

  exec { 'Configure_OML':
    command => '/opt/OV/bin/OpC/install/oainstall.sh -configure -agent',
    creates => [
      '/var/opt/OV/installation/inventory/HPOvAgtLc.xml',
      '/var/opt/OV/installation/inventory/HPOvBbc.xml',
      '/var/opt/OV/installation/inventory/HPOvConf.xml',
      '/var/opt/OV/installation/inventory/HPOvCtrl.xml',
      '/var/opt/OV/installation/inventory/HPOvDepl.xml',
      '/var/opt/OV/installation/inventory/HPOvEaAgt.xml',
      '/var/opt/OV/installation/inventory/HPOvGlanc.xml',
      '/var/opt/OV/installation/inventory/HPOvPacc.xml',
      '/var/opt/OV/installation/inventory/HPOvPerfAgt.xml',
      '/var/opt/OV/installation/inventory/HPOvPerfMI.xml',
      '/var/opt/OV/installation/inventory/HPOvPerlA.xml',
      '/var/opt/OV/installation/inventory/HPOvSecCC.xml',
      '/var/opt/OV/installation/inventory/HPOvSecCo.xml',
      '/var/opt/OV/installation/inventory/HPOvXpl.xml',
      '/var/opt/OV/installation/inventory/Operations-agent.xml',
    ],
    require => Exec['Install_OML'],
  }

  exec { 'Activate_OML':
    command => "/opt/OV/bin/OpC/install/opcactivate -srv ${server} -cert_srv 
${server}",
    unless  => "/opt/OV/bin/ovconfget sec.core.auth MANAGER | /bin/grep 
${server}",
    require => Exec['Configure_OML'],
  }

  # only patch if ovo is already installed and if the current version
  # is below the minversion. We do not downgrade.
  if $::opcagtversion and versioncmp($::opcagtversion, $minversion) < 0 {
    exec { 'Patch_OML':
      command => "${installer} ${update_arguments}",
      timeout => '1800',  # 30 minutes
      require => Exec['Install_OML'],
    }
  }
}

works pretty well. If we get a new version I try the installer by hand
a couple of times (the class does not downgrade, only upgrade). If it
does not fail I bump the $minversion default parameter and puppet will
patch all my systems.

-Stefan

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to