From bcefe1ff00d3368f308729ac4481ee6c164bb596 Mon Sep 17 00:00:00 2001 From: Ossi Herrala Date: Mon, 2 Apr 2012 12:52:41 +0000 Subject: [PATCH 1/4] Run commands with more permissive umask. --- python/manifests/init.pp | 2 +- util/manifests/init.pp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/manifests/init.pp b/python/manifests/init.pp index 09ba3a4..5a90d09 100644 --- a/python/manifests/init.pp +++ b/python/manifests/init.pp @@ -16,7 +16,7 @@ define python::setup::install($python="python") { exec { "python-setup-install-${name}": path => "/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin", cwd => "${name}", - command => "${python} setup.py install", + command => "/bin/sh -c 'umask 022; ${python} setup.py install'", creates => "${name}/build", } diff --git a/util/manifests/init.pp b/util/manifests/init.pp index ebb74f8..11ba8cf 100644 --- a/util/manifests/init.pp +++ b/util/manifests/init.pp @@ -57,9 +57,9 @@ define util::extract::tar($source, $ensure=present, $strip=0, $preserve=false) { } if $preserve { - $command = "${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name}" + $command = "/bin/sh -c 'umask 022; ${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name}'" } else { - $command = "${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name} --no-same-owner --no-same-permissions" + $command = "/bin/sh -c 'umask 022; ${cat} ${source} | ${tar} xf - --strip-components=${strip} -C ${name} --no-same-owner --no-same-permissions'" } exec { "tar-extract-${name}": From e8263790fb29d6d4bce723156e0a4a528ea00a19 Mon Sep 17 00:00:00 2001 From: Ossi Herrala Date: Mon, 2 Apr 2012 12:55:41 +0000 Subject: [PATCH 2/4] KVM support for CentOS 5 (5.8, maybe 5.9 if such thing comes out). --- libvirt/manifests/init.pp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/libvirt/manifests/init.pp b/libvirt/manifests/init.pp index 88abc0e..7820081 100644 --- a/libvirt/manifests/init.pp +++ b/libvirt/manifests/init.pp @@ -29,10 +29,25 @@ class libvirt::client { # class libvirt::kvm inherits libvirt::client { - package { "qemu-kvm": - ensure => installed, - before => Service["libvirtd"], - require => [ User["qemu"], Group["qemu"] ], + case operatingsystem { + centos,fedora: { + case $operatingsystemrelease { + '/5\.[8-9]': { + package { "kvm": + ensure => installed, + before => Service["libvirtd"], + require => [ User["qemu"], Group["qemu"] ], + } + } + '/6\.[0-9]': { + package { "qemu-kvm": + ensure => installed, + before => Service["libvirtd"], + require => [ User["qemu"], Group["qemu"] ], + } + } + } + } } if !$libvirt_admingroup { @@ -41,7 +56,7 @@ class libvirt::kvm inherits libvirt::client { file { "/etc/libvirt/libvirtd.conf": ensure => present, - mode => "0644", + mode => 0644, owner => "root", group => "root", content => template("libvirt/libvirtd.conf.erb"), From b2a5316efc2a699b7ee222c0b9a34a0164c191dd Mon Sep 17 00:00:00 2001 From: Ossi Herrala Date: Mon, 2 Apr 2012 13:23:30 +0000 Subject: [PATCH 3/4] Use "default" case for CentOS/Redhat 6. Change file mode to be in quotes. --- libvirt/manifests/init.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt/manifests/init.pp b/libvirt/manifests/init.pp index 7820081..7844727 100644 --- a/libvirt/manifests/init.pp +++ b/libvirt/manifests/init.pp @@ -32,14 +32,14 @@ class libvirt::kvm inherits libvirt::client { case operatingsystem { centos,fedora: { case $operatingsystemrelease { - '/5\.[8-9]': { + '/5\.[8-9]/': { package { "kvm": ensure => installed, before => Service["libvirtd"], require => [ User["qemu"], Group["qemu"] ], } } - '/6\.[0-9]': { + default: { package { "qemu-kvm": ensure => installed, before => Service["libvirtd"], @@ -56,7 +56,7 @@ class libvirt::kvm inherits libvirt::client { file { "/etc/libvirt/libvirtd.conf": ensure => present, - mode => 0644, + mode => "0644", owner => "root", group => "root", content => template("libvirt/libvirtd.conf.erb"), From 37b64a72e8a44ca47fb38e0a6ad3bbde16d3b785 Mon Sep 17 00:00:00 2001 From: Ossi Herrala Date: Mon, 2 Apr 2012 13:34:56 +0000 Subject: [PATCH 4/4] Tweaking the regexp more. --- libvirt/manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt/manifests/init.pp b/libvirt/manifests/init.pp index 7844727..051e949 100644 --- a/libvirt/manifests/init.pp +++ b/libvirt/manifests/init.pp @@ -32,7 +32,7 @@ class libvirt::kvm inherits libvirt::client { case operatingsystem { centos,fedora: { case $operatingsystemrelease { - '/5\.[8-9]/': { + '/5\.[0-9]+/': { package { "kvm": ensure => installed, before => Service["libvirtd"],