Merged in oherrala/puppet (pull request #17)

This commit is contained in:
Timo Mäkinen 2012-11-08 12:48:34 +02:00
commit 59ed1ced8f
3 changed files with 115 additions and 5 deletions

41
dell/manifests/init.pp Normal file
View file

@ -0,0 +1,41 @@
class dell::common {
case $::operatingsystem {
"centos", "redhat": {
include yum::repo::dell
}
default: {
fail("Dell modules not supported in ${operatingsystem}")
}
}
}
# Tools and services for Dell iDRAC7 management
#
class dell::idrac7 {
include dell::common
package { 'srvadmin-idrac7':
ensure => installed,
require => Class["yum::repo::dell"],
}
# Enable OpenManage System services
exec { "srvadmin-service-enable":
command => "/opt/dell/srvadmin/sbin/srvadmin-services.sh enable",
creates => "/etc/rc2.d/S97dataeng",
user => "root",
group => "root",
require => Exec["srvadmin-service-start"],
}
# Start OpenManage System services
exec { "srvadmin-service-start":
command => "/opt/dell/srvadmin/sbin/srvadmin-services.sh start",
unless => "/usr/bin/pgrep -f /opt/dell/srvadmin/sbin/dsm_sa_datamgrd",
user => "root",
group => "root",
require => Package["srvadmin-idrac7"],
}
}

View file

@ -35,8 +35,33 @@ class libvirt::client {
# $libvirt_admingroup:
# Group which has access to system libvirtd.
#
# $libvirt_guest_on_boot
# Action to taken on host boot [start, ignore] (default: start)
#
# $libvirt_guest_on_shutdown
# Action to taken on host shutdown [suspend, shutdown] (default: suspend)
#
# $libvirt_parallel_shutdown
# If set to non-zero, shutdown will suspend guests concurrently. (default: 0)
#
class libvirt::kvm inherits libvirt::client {
if !$libvirt_admingroup {
$libvirt_admingroup = "root"
}
if !$libvirt_guest_on_boot {
$libvirt_guest_on_boot = "start"
}
if !$libvirt_guest_on_shutdown {
$libvirt_guest_on_shutdown = "suspend"
}
if !$libvirt_parallel_shutdown {
$libvirt_parallel_shutdown = 0
}
case $operatingsystem {
centos,fedora: {
case $operatingsystemrelease {
@ -58,16 +83,20 @@ class libvirt::kvm inherits libvirt::client {
}
}
}
file { "/etc/sysconfig/libvirt-guests":
ensure => present,
mode => "0644",
owner => "root",
group => "root",
content => template("libvirt/sysconfig-libvirt-guests.erb"),
require => Package["libvirt"],
}
}
default: {
fail("Operating system not supported")
}
}
if !$libvirt_admingroup {
$libvirt_admingroup = "root"
}
file { "/etc/libvirt/libvirtd.conf":
ensure => present,
mode => "0644",
@ -82,6 +111,5 @@ class libvirt::kvm inherits libvirt::client {
ensure => running,
enable => true,
}
}

View file

@ -0,0 +1,41 @@
# URIs to check for running guests
# example: URIS='default xen:/// vbox+tcp://host/system lxc:///'
#URIS=default
# action taken on host boot
# - start all guests which were running on shutdown are started on boot
# regardless on their autostart settings
# - ignore libvirt-guests init script won't start any guest on boot, however,
# guests marked as autostart will still be automatically started by
# libvirtd
ON_BOOT=<%= libvirt_guest_on_boot %>
# Number of seconds to wait between each guest start. Set to 0 to allow
# parallel startup.
#START_DELAY=0
# action taken on host shutdown
# - suspend all running guests are suspended using virsh managedsave
# - shutdown all running guests are asked to shutdown. Please be careful with
# this settings since there is no way to distinguish between a
# guest which is stuck or ignores shutdown requests and a guest
# which just needs a long time to shutdown. When setting
# ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
# value suitable for your guests.
ON_SHUTDOWN=<%= libvirt_guest_on_shutdown %>
# If set to non-zero, shutdown will suspend guests concurrently. Number of
# guests on shutdown at any time will not exceed number set in this variable.
PARALLEL_SHUTDOWN=<%= libvirt_parallel_shutdown %>
# Number of seconds we're willing to wait for a guest to shut down. If parallel
# shutdown is enabled, this timeout applies as a timeout for shutting down all
# guests on a single URI defined in the variable URIS. If this is 0, then there
# is no time out (use with caution, as guests might not respond to a shutdown
# request). The default value is 300 seconds (5 minutes).
#SHUTDOWN_TIMEOUT=300
# If non-zero, try to bypass the file system cache when saving and
# restoring guests, even though this may give slower operation for
# some file systems.
#BYPASS_CACHE=0