From 71b4eb0062a80286e5d58aa637b77221ffa105a5 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Fri, 20 Jun 2014 16:20:40 +0200 Subject: [PATCH] Only enabling rsyslog service if not chroot Builds running in a chroot are failing when notifying to rsyslog. Assuming that an env var called FACTER_in_chroot is sent on this case (as done by disk-image-builder elements), ignore the declaration and interaction with rsyslog. Change-Id: Id4c7a3e0c3503904540c59d940b52481d263d5b9 --- .../openstack_project/manifests/template.pp | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/openstack_project/manifests/template.pp b/modules/openstack_project/manifests/template.pp index e51b27ad7f..3e23296479 100644 --- a/modules/openstack_project/manifests/template.pp +++ b/modules/openstack_project/manifests/template.pp @@ -58,6 +58,20 @@ class openstack_project::template ( ensure => present, } + if ($::in_chroot) { + notify { 'rsyslog in chroot': + message => 'rsyslog not refreshed, running in chroot', + } + $rsyslog_notify = [] + } else { + service { 'rsyslog': + ensure => running, + enable => true, + hasrestart => true, + } + $rsyslog_notify = [ Service['rsyslog'] ] + } + # Custom rsyslog config to disable /dev/xconsole noise on Debuntu servers file { '/etc/rsyslog.d/50-default.conf': ensure => present, @@ -67,7 +81,7 @@ class openstack_project::template ( source => 'puppet:///modules/openstack_project/rsyslog.d_50-default.conf', replace => true, - notify => Service['rsyslog'], + notify => $rsyslog_notify, } # Ubuntu installs their whoopsie package by default, but it eats through @@ -86,13 +100,7 @@ class openstack_project::template ( owner => 'root', group => 'root', mode => '0644', - notify => Service['rsyslog'], - } - - service { 'rsyslog': - ensure => running, - enable => true, - hasrestart => true, + notify => $rsyslog_notify, } if ($::osfamily == 'RedHat') {