diff options
Diffstat (limited to 'manifests/xen')
-rw-r--r-- | manifests/xen/dom0.pp | 7 | ||||
-rw-r--r-- | manifests/xen/dom0/base.pp | 1 | ||||
-rw-r--r-- | manifests/xen/dom0/centos.pp | 5 | ||||
-rw-r--r-- | manifests/xen/dom0/debian.pp | 27 | ||||
-rw-r--r-- | manifests/xen/domain.pp | 12 | ||||
-rw-r--r-- | manifests/xen/domain/base.pp | 31 | ||||
-rw-r--r-- | manifests/xen/domain/centos.pp | 32 | ||||
-rw-r--r-- | manifests/xen/domain/debian.pp | 22 | ||||
-rw-r--r-- | manifests/xen/munin/plugins.pp | 15 |
9 files changed, 152 insertions, 0 deletions
diff --git a/manifests/xen/dom0.pp b/manifests/xen/dom0.pp new file mode 100644 index 0000000..2c51b56 --- /dev/null +++ b/manifests/xen/dom0.pp @@ -0,0 +1,7 @@ +class virtual::xen::dom0 inherits xen::domain { + case $operatingsystem { + debian: { include xen::dom0::debian } + centos: { include xen::dom0::centos } + default: { include xen::dom0::base } + } +} diff --git a/manifests/xen/dom0/base.pp b/manifests/xen/dom0/base.pp new file mode 100644 index 0000000..85411cf --- /dev/null +++ b/manifests/xen/dom0/base.pp @@ -0,0 +1 @@ +class virtual::xen::dom0::base {} diff --git a/manifests/xen/dom0/centos.pp b/manifests/xen/dom0/centos.pp new file mode 100644 index 0000000..f0fd14d --- /dev/null +++ b/manifests/xen/dom0/centos.pp @@ -0,0 +1,5 @@ +class virtual::xen::dom0::centos inherits xen::dom0::base { + package{ [ "xen", "xen-libs"]: + ensure => present, + } +} diff --git a/manifests/xen/dom0/debian.pp b/manifests/xen/dom0/debian.pp new file mode 100644 index 0000000..56ec52c --- /dev/null +++ b/manifests/xen/dom0/debian.pp @@ -0,0 +1,27 @@ +class virtual::xen::dom0::debian inherits xen::dom0::base { + $real_xen_lvm = $xen_lvm ? { + '' => "vg_${hostname}0", + default => $xen_lvm, + } + case $lsbdistcodename { + lenny: { + package { + "xen-tools": + ensure => "4.1-1~bpo50+1", + } + } + squeeze: { + package { + "xen-tools": + ensure => installed; + } + } + } + + file { + "/etc/xen-tools/xen-tools.conf": + owner => root, group => 0, mode => 0644, + content => template("site_virtual/xen/${operatingsystem}/${lsbdistcodename}/xen-tools.conf.erb"), + require => Package['xen-tools']; + } +} diff --git a/manifests/xen/domain.pp b/manifests/xen/domain.pp new file mode 100644 index 0000000..30a0fdf --- /dev/null +++ b/manifests/xen/domain.pp @@ -0,0 +1,12 @@ +# XEN specifica +# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at> +# See LICENSE for the full license granted to you. +class virtual::xen::domain { + include virtual + + case $operatingsystem { + debian: { include xen::domain::debian } + centos: { include xen::domain::centos } + default: { include xen::domain::base } + } +} diff --git a/manifests/xen/domain/base.pp b/manifests/xen/domain/base.pp new file mode 100644 index 0000000..c77becb --- /dev/null +++ b/manifests/xen/domain/base.pp @@ -0,0 +1,31 @@ +class virtual::xen::domain::base { + service{ 'xend': + ensure => running, + enable => true, + hasstatus => false, + hasrestart => 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:///modules/site_virtual/xen/config/${fqdn}/config/xend-config.sxp", + "puppet:///modules/site_virtual/xen/config/${domain}/xend-config.sxp", + "puppet:///modules/site_virtual/xen/config/${operatingsystem}/xend-config.sxp", + "puppet:///modules/site_virtual/xen/config/${operatingsystem}/${lsbdistcodeename}/xend-config.sxp", + "puppet:///modules/site_virtual/xen/config/xend-config.sxp", + "puppet:///modules/virtual/xen/config/${operatingsystem}/xend-config.sxp", + "puppet:///modules/virtual/xen/config/xend-config.sxp" ], + notify => Service['xend'], + owner => root, group => 0, mode => 0644; + } +} diff --git a/manifests/xen/domain/centos.pp b/manifests/xen/domain/centos.pp new file mode 100644 index 0000000..bd01338 --- /dev/null +++ b/manifests/xen/domain/centos.pp @@ -0,0 +1,32 @@ +class virtual::xen::domain::centos inherits xen::domain::base { + package{ 'kernel-xen': + ensure => present, + } + + Service[xend]{ + require => Package['kernel-xen'], + } + + file{'/etc/sysconfig/xend': + source => "puppet:///modules/virtual/xen/${operatingsystem}/sysconfig/xend", + notify => Service['xend'], + owner => root, group => 0, mode => 0644; + } + + file{'/etc/sysconfig/xendomains': + source => "puppet:///modules/virtual/xen/${operatingsystem}/sysconfig/xendomains", + owner => root, group => 0, mode => 0644; + } + + 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] + } + } + } +} diff --git a/manifests/xen/domain/debian.pp b/manifests/xen/domain/debian.pp new file mode 100644 index 0000000..8c916c8 --- /dev/null +++ b/manifests/xen/domain/debian.pp @@ -0,0 +1,22 @@ +class virtual::xen::domain::debian inherits xen::domain::base { + case $lsbdistcodename { + "lenny": { + $xen_linux_system = $architecture ? { + amd64 => "xen-linux-system-2.6.26-2-xen-amd64", + i386 => "xen-linux-system-2.6.26-2-xen-686" + } + } + "squeeze": { + $xen_linux_system = $architecture ? { + /(amd64|x86_64)/ => "xen-linux-system-2.6.32-5-xen-amd64", + i386 => "xen-linux-system-2.6.32-5-xen-686" + } + } + } + + package { + "$xen_linux_system": + ensure => present, + alias => "xen-linux-system"; + } +} diff --git a/manifests/xen/munin/plugins.pp b/manifests/xen/munin/plugins.pp new file mode 100644 index 0000000..00982ce --- /dev/null +++ b/manifests/xen/munin/plugins.pp @@ -0,0 +1,15 @@ +class virtual::xen::munin::plugins { + munin::remoteplugin { + xen-multi: + source => "puppet:///modules/virtual/munin/xen_mem", + config => "user root", + ensure => absent; + xen_vm: + source => "puppet:///modules/virtual/munin/xen_vm", + config => "user root", + ensure => absent; + 'xen-multi': + source => 'puppet:///modules/virtual/munin/xen-multi', + config => 'user root'; + } +} |