diff options
author | Pietro Ferrari <pietro@riseup.net> | 2008-11-11 00:16:41 +0000 |
---|---|---|
committer | Pietro Ferrari <pietro@riseup.net> | 2008-11-11 00:16:41 +0000 |
commit | b43b2a2d5b0c424f3fce801f9158af60df20978a (patch) | |
tree | b1e48d613ee0d76a686a83c2ccdec4f769060c89 /manifests/xen.pp | |
parent | 0a4679409748b22f464526ec2c4aad1771c80b80 (diff) | |
download | puppet-virtual-b43b2a2d5b0c424f3fce801f9158af60df20978a.tar.gz puppet-virtual-b43b2a2d5b0c424f3fce801f9158af60df20978a.tar.bz2 |
merge some changes from immerda repository. specially xen related.
Diffstat (limited to 'manifests/xen.pp')
-rw-r--r-- | manifests/xen.pp | 118 |
1 files changed, 104 insertions, 14 deletions
diff --git a/manifests/xen.pp b/manifests/xen.pp index afaa59c..35a5c4a 100644 --- a/manifests/xen.pp +++ b/manifests/xen.pp @@ -5,34 +5,124 @@ class munin::plugins::xen { munin::remoteplugin { xen_mem: - source => "puppet://$servername/virtual/munin/xen_mem", + source => "puppet://$server/virtual/munin/xen_mem", config => "user root"; xen_vm: - source => "puppet://$servername/virtual/munin/xen_vm", + source => "puppet://$server/virtual/munin/xen_vm", config => "user root"; } } class xen::domain { - # install the special libc and parameters to enable it - $xen_ensure = $virtual ? { - 'xen0' => present, - 'xenu' => present, - default => 'absent' - } + case $operatingsystem { + debian: { include xen::domain::debian } + centos: { include xen::domain::centos } + default: { include xen::domain::base } + } +} - case $ensure { - 'absent': { err("xen::domain configured, but not detected") } - } +class xen::domain::base { + service{ 'xend': + ensure => running, + enable => true, + hasstatus => true, + } + + case $xen_domains { + '0': { info("No xen domains are running, so not configuring service xendomains") } + default: { + service{ 'xendomains': + ensure => running, + enable => true, + hasstatus => true, + } + } + } + + file{'/etc/xen/xend-config.sxp': + source => [ "puppet://$server/files/virtual/xen/${fqdn}/config/xend-config.sxp", + "puppet://$server/files/virtual/xen/config/${domain}/xend-config.sxp", + "puppet://$server/files/virtual/xen/config/${operatingsystem}/xend-config.sxp", + "puppet://$server/files/virtual/xen/config/xend-config.sxp", + "puppet://$server/virtual/xen/config/${operatingsystem}/xend-config.sxp", + "puppet://$server/virtual/xen/config/xend-config.sxp" ], + notify => Service['xend'], + owner => root, group => 0, mode => 0644; + } +} + +class xen::domain::centos inherits xen::domain::base { + package{ 'kernel-xen': + ensure => present, + } + + Service[xend]{ + require => Package['kernel-xen'], + } + + file{'/etc/sysconfig/xend': + source => "puppet://$server/virtual/xen/${operatingsystem}/sysconfig/xend", + notify => Service['xend'], + owner => root, group => 0, mode => 0644; + } + + file{'/etc/sysconfig/xendomains': + source => "puppet://$server/virtual/xen/${operatingsystem}/sysconfig/xendomains", + owner => root, group => 0, mode => 0644; + } - package { libc6-xen: - ensure => $xen_ensure, + case $xen_domains { + '0': { info("No xen domains are running, so not configuring service xendomains") } + default: { + Service[xendomains]{ + require => Package['kernel-xen'], + } + File['/etc/sysconfig/xendomains']{ + notify => Service[xendomains] + } + } + } +} + +class xen::domain::debian inherits xen::domain::base { + # This package is i386 only + # See also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=379444 + case $architecture { + 'i386': { + package { libc6-xen: + ensure => 'present', + } + } } config_file { "/etc/ld.so.conf.d/nosegneg.conf": ensure => $xen_ensure, content => "hwcap 0 nosegneg\n", - } + } +} +class xen::dom0 inherits xen::domain { + case $operatingsystem { + debian: { include xen::dom0::debian } + centos: { include xen::dom0::centos } + default: { include xen::dom0::base } + } +} + +class xen::dom0::base {} +class xen::dom0::centos inherits xen::dom0::base { + package{ [ "xen", "xen-libs"]: + ensure => present, + } +} +class xen::dom0::debian inherits xen::dom0::base { + # install the packages required for managing xen + package { + [ "xen-hypervisor-3.0.3-1-$architecture", + "linux-image-xen-$architecture", + 'libsysfs2' + ]: + ensure => present + } } |