Permalink
Browse files

Initial commit.

  • Loading branch information...
0 parents commit dc86f705f1c44ea9c94b3973b899eacde68fbb37 @vholer vholer committed Apr 5, 2012
@@ -0,0 +1,42 @@
+# Puppet hp_proliant module
+
+This module setups package repository for HP ProLiant Support Pack.
+It can be also used to install and configure basic tools.
+
+### Overview
+
+...
+
+### Requirements
+
+Module has been tested on:
+
+* Puppet 2.7
+* Debian 6.0
+* physical HP ProLiant server (requires facts manufacturer and productname)
+
+# Quick Start
+
+Quick basic setup
+
+ include hp_proliant
+
+Full configuration options:
+
+ class { 'hp_proliant':
+ force => false|true, # force setup on non-HP hardware
+ repo => false|true, # configure HP pkg. repository
+ hasstatus => false|ture, # use service status or process pattern check?
+ use_acucli => false|true, # setup: HP Array CLI
+ use_oncfg => false|true, # setup: ILOE II/iLo online CLI
+ use_health => false|true, # setup: HP System Health app. and CLI
+ use_snmp_agents => false|true, # setup: Insight Mgmt. SNMP Agents
+
+ # cma.conf parameters
+ cma_exclude => '...',
+ cma_trapemail => '...',
+ cma_cmaXSocketIf => '...',
+ cma_cmaXSocketBase => '...',
+ cma_cmaCloseCcissHandle => '...',
+ cma_trapIf => '...',
+ }
@@ -0,0 +1,6 @@
+class hp_proliant::acucli {
+ package {
+ 'hpacucli':
+ ensure => present,
+ }
+}
@@ -0,0 +1,22 @@
+class hp_proliant::health (
+ $hasstatus
+) {
+ package {
+ 'hp-health':
+ ensure => present,
+ }
+
+ Service {
+ ensure => running,
+ enable => true,
+ hasstatus => $hasstatus,
+ require => Package['hp-health']
+ }
+
+ service {
+ 'hp-health':
+ pattern => 'hpasm(|xl|lite|pl)d';
+ 'hp-asrd':
+ pattern => 'hp-asrd';
+ }
+}
@@ -0,0 +1,75 @@
+class hp_proliant (
+ $force = $hp_proliant::params::force,
+ $repo = $hp_proliant::params::repo,
+ $hasstatus = $hp_proliant::params::hasstatus,
+ $use_acucli = $hp_proliant::params::use_acucli,
+ $use_oncfg = $hp_proliant::params::use_oncfg,
+ $use_health = $hp_proliant::params::use_health,
+ $use_snmp_agents = $hp_proliant::params::use_snmp_agents,
+ $cma_exclude = $hp_proliant::params::cma_exclude,
+ $cma_trapemail = $hp_proliant::params::cma_trapemail,
+ $cma_cmaXSocketIf = $hp_proliant::params::cma_cmaXSocketIf,
+ $cma_cmaXSocketBase = $hp_proliant::params::cma_cmaXSocketBase,
+ $cma_cmaCloseCcissHandle = $hp_proliant::params::cma_cmaCloseCcissHandle,
+ $cma_trapIf = $hp_proliant::params::cma_trapIf
+) inherits hp_proliant::params {
+
+ import 'stdlib'
+
+ # works only on bare metal HP server or forced
+ if $force == true or (
+ ($::is_virtual == 'false') and
+ ($::manufacturer == 'HP') and
+ ($::productname =~ /^(?i-mx:ProLiant)/))
+ {
+ anchor { 'hp_proliant::begin': ; }
+ -> anchor { 'hp_proliant::end': ; }
+
+ # before we start, setup pkg. repository
+ if $repo {
+ class { "${hp_proliant::params::repo_class}": ; }
+ -> Anchor['hp_proliant::begin']
+ }
+
+ # real setup
+ if $use_acucli {
+ Anchor['hp_proliant::begin']
+ -> class { 'hp_proliant::acucli': ; }
+ -> Anchor['hp_proliant::end']
+ }
+
+ if $use_oncfg {
+ Anchor['hp_proliant::begin']
+ -> class { 'hp_proliant::oncfg': ; }
+ -> Anchor['hp_proliant::end']
+ }
+
+ if $use_health {
+ class {
+ 'hp_proliant::health':
+ hasstatus => $hasstatus;
+ }
+
+ Anchor['hp_proliant::begin']
+ -> Class['hp_proliant::health']
+ -> Anchor['hp_proliant::end']
+ }
+
+ if $use_snmp_agents {
+ class {
+ 'hp_proliant::snmp_agents':
+ hasstatus => $hasstatus,
+ exclude => $cma_exclude,
+ trapemail => $cma_trapemail,
+ trapIf => $cma_trapIf,
+ cmaXSocketIf => $cma_cmaXSocketIf,
+ cmaXSocketBase => $cma_cmaXSocketBase,
+ cmaCloseCcissHandle => $cma_cmaCloseCcissHandle,
+ }
+
+ Anchor['hp_proliant::begin']
+ -> Class['hp_proliant::snmp_agents']
+ -> Anchor['hp_proliant::end']
+ }
+ }
+}
@@ -0,0 +1,7 @@
+class hp_proliant::oncfg {
+ package {
+ 'hponcfg':
+ ensure => present,
+ require => Class['hp_proliant::health'],
+ }
+}
@@ -0,0 +1,31 @@
+class hp_proliant::params {
+ case $::operatingsystem {
+ debian,ubuntu: {
+ $repo_class = 'hp_proliant::repo::debian'
+ }
+
+ fedora,redhat,oel,centos: {
+ fail("Unsupported OS (${::operatingsystem}), please check module https://github.com/runningman/puppet-psp")
+ }
+
+ default: {
+ fail("Unsupported OS (${::operatingsystem})")
+ }
+ }
+
+ if $force == '' { $force = false }
+ if $repo == '' { $repo = true }
+ if $hasstatus == '' { $hasstatus = true }
+ if $use_acucli == '' { $use_acucli = true }
+ if $use_oncfg == '' { $use_oncfg = true }
+ if $use_health == '' { $use_health = true }
+ if $use_snmp_agents == '' { $use_snmp_agents = true }
+
+ # HP SNMP agents - cma.conf
+ if $cma_exclude == '' { $cma_exclude = '' }
+ if $cma_trapemail == '' { $cma_trapemail = "/usr/bin/mail -s 'HP Insight Management Agents Trap Alarm' root" }
+ if $cma_cmaXSocketIf == '' { $cma_cmaXSocketIf = '' }
+ if $cma_cmaXSocketBase == '' { $cma_cmaXSocketBase = '' }
+ if $cma_cmaCloseCcissHandle == '' { $cma_cmaCloseCcissHandle = '' }
+ if $cma_trapIf == '' { $cma_trapIf = '' }
+}
@@ -0,0 +1,21 @@
+# Class: hp_proliant::repo::debian.pp
+#
+# HP Software Delivery Repository for ProLiantSupportPack
+#
+class hp_proliant::repo::debian {
+ warning("By including and using this configuration, you agree to the \
+terms and conditions of the HP Software License Agreement at \
+http://h20000.www2.hp.com/bizsupport/TechSupport/softwareLicense.jsp?lang=en&cc=us&prodTypeId=15351&prodSeriesId=1121516&prodNameId=3288134&taskId=135")
+
+ if $::lsbdistcodename == '' {
+ fail('lsbdistcodename fact not available')
+ }
+
+ apt::source {
+ 'hp_proliant':
+ location => 'http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack',
+ release => "${::lsbdistcodename}/current",
+ repos => 'non-free',
+ key => '2689B887',
+ }
+}
@@ -0,0 +1,20 @@
+# Class: hp_proliant::repo::debian.pp
+#
+# HP Software Delivery Repository for ProLiantSupportPack
+#
+class hp_proliant::repo::debian {
+ warning("By including and using this configuration, you agree to the \
+terms and conditions of the HP Software License Agreement at \
+http://h20000.www2.hp.com/bizsupport/TechSupport/softwareLicense.jsp?lang=en&cc=us&prodTypeId=15351&prodSeriesId=1121516&prodNameId=3288134&taskId=135")
+
+ if $::lsbdistcodename == '' {
+ fail('lsbdistcodename fact not available')
+ }
+
+ apt::source { 'hp_proliant':
+ location => 'http://downloads.linux.hp.com/SDR/downloads/ProLiantSupportPack',
+ release => "${::lsbdistcodename}/current",
+ repos => 'non-free',
+ key => '2689B887',
+ }
+}
@@ -0,0 +1,42 @@
+class hp_proliant::snmp_agents (
+ $hasstatus,
+ $exclude,
+ $trapemail,
+ $cmaXSocketIf,
+ $cmaXSocketBase,
+ $cmaCloseCcissHandle,
+ $trapIf
+) {
+ package {
+ 'hp-snmp-agents':
+ ensure => present,
+ require => Class['hp_proliant::health'],
+ }
+
+ file {
+ '/opt/hp/hp-snmp-agents/cma.conf':
+ require => Package['hp-snmp-agents'],
+ ensure => file,
+ content => template('hp_proliant/cma.conf.erb'),
+ notify => Service['hp-snmp-agents'],
+ }
+
+ snmp::server::config::snmpd {
+ 'hp_proliant-snmp-agents':
+ content => "
+# HP Insight Management Agents cfg.
+dlmod cmaX /usr/lib64/libcmaX64.so";
+ }
+
+ service {
+ 'hp-snmp-agents':
+ ensure => running,
+ enable => true,
+ hasstatus => $hasstatus,
+ pattern => 'cmahealthd', #HACK: we only check for one of many daemons
+ require => [
+ File['/opt/hp/hp-snmp-agents/cma.conf'],
+ Class['snmp::server']
+ ],
+ }
+}
@@ -0,0 +1,69 @@
+############################################################
+#
+# cma.conf: HP Insight Management Agents configuration file
+#
+############################################################
+
+########################################################################
+# exclude is used to exclude individual agents from starting by default.
+# Simply add the name of the agent(s) after the exclude directive.
+########################################################################
+exclude <%= exclude %>
+
+
+########################################################################
+# trapemail is used for configuring email command(s) which will be
+# executed whenever a SNMP trap is generated.
+# Multiple trapemail lines are allowed.
+# Note: any command that reads standard input can be used. For example:
+# trapemail /usr/bin/logger
+# will log trap messages into system log (/var/log/messages).
+########################################################################
+trapemail <%= trapemail %>
+
+
+########################################################################
+# cmaXSocketIf is used to override the default network interface used
+# for communications between HP Insight Management Agents Extension
+# (cmaX), agents, and the snmp daemon.
+# cmaXSocketIf is not required, but may be useful if cmaX traffic on the
+# "lo" network interface is undesirable.
+########################################################################
+#cmaXSocketIf lo
+<% if @cmaXSocketIf != '' -%>cmaXSocketIf <%= cmaXSocketIf %><% end -%>
+
+########################################################################
+# cmaXSocketBase is used to override the default socket base used for
+# communications between HP Insight Management Agents Extension (cmaX) and
+# agents.
+# cmaXSocketBase is not required unless following message showed up
+# in Agents log file (/var/spool/compaq/cma.log):
+# "bind() failed!"
+########################################################################
+#cmaXSocketBase 87654321
+<% if @cmaXSocketBase != '' -%>cmaXSocketBase <%= cmaXSocketBase %><% end -%>
+
+#######################################################################
+# cmaCloseCcissHandle is used by storage agents to work around a kernel
+# performance issue that closing file handles of CCISS controller device
+# may take lots of CPU time on servers that have more than 4GB memory.
+# cmaCloseCcissHandle is set to ON by default so that agent will open,
+# issue ioctls, then close CCISS device handle once per controller per
+# poll. If cmaCloseCcissHandle is set to OFF, storage agents (cmaidad,
+# cmaeventd, and cmafcad) will NOT issue any time consuming "close"
+# system calls to any CCISS controller handles. As a result, file
+# handles to the first disk of any CCISS controller will be kept open,
+# so "fdisk" or ACU configuration will not be functional on those disks
+# while cmaidad, cmaeventd, or cmafcad are running if cmaCloseCcissHandle
+# is set to OFF.
+######################################################################
+#cmaCloseCcissHandle ON
+<% if @cmaCloseCcissHandle != '' -%>cmaCloseCcissHandle <%= cmaCloseCcissHandle %><% end -%>
+
+########################################################################
+# trapIf is used to inform the SNMP daemon which IP Address to use while
+# sending the traps. Use trapIf <interface> if you have multiple NICs
+# configured with IP Addresses.
+########################################################################
+#trapIf eth0
+<% if @trapIf != '' -%>trapIf <%= trapIf %><% end -%>
@@ -0,0 +1,9 @@
+class { 'hp_proliant':
+ force => true,
+ hasstatus => true,
+ repo => true,
+ use_acucli => true,
+ use_oncfg => true,
+ use_health => true,
+ use_snmp_agents => true,
+}
@@ -0,0 +1,9 @@
+class { 'hp_proliant':
+ force => true,
+ hasstatus => false,
+ repo => true,
+ use_acucli => true,
+ use_oncfg => true,
+ use_health => true,
+ use_snmp_agents => true,
+}
@@ -0,0 +1 @@
+include hp_proliant::repo::debian

0 comments on commit dc86f70

Please sign in to comment.