diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-09-12 12:57:38 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-09-12 12:57:38 -0300 |
commit | 2cd029f433e377b1d629cdaf7146b7e90546df33 (patch) | |
tree | 8597639cc4d6295ddc2290dd043880c3cd492444 /manifests/xen/domain | |
parent | c2e477d0a8667bc3a983105421d5c048faa31661 (diff) | |
download | puppet-virtual-2cd029f433e377b1d629cdaf7146b7e90546df33.tar.gz puppet-virtual-2cd029f433e377b1d629cdaf7146b7e90546df33.tar.bz2 |
Puppet autoload support
This commit move stuff around and rename classes and
definitions so we can benefit from puppet autoloading.
Diffstat (limited to 'manifests/xen/domain')
-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 |
3 files changed, 85 insertions, 0 deletions
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"; + } +} |