From 53c19e4a83782daa518ac2597ff751c8ac5111a0 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Sun, 19 Apr 2015 15:43:47 -0400 Subject: require package before config files In the current state of the module, almost 100% of the time nagios doesn't install correctly since ordering of the resources is not enforced. --- manifests/base.pp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/manifests/base.pp b/manifests/base.pp index 8f99564..687261d 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -22,8 +22,9 @@ class nagios::base { "puppet:///modules/site_nagios/configs/nagios.cfg", "puppet:///modules/nagios/configs/${::operatingsystem}/nagios.cfg", "puppet:///modules/nagios/configs/nagios.cfg" ], - notify => Service['nagios'], - mode => 0644, owner => root, group => root; + notify => Service['nagios'], + require => Package['nagios'], + mode => 0644, owner => root, group => root; } file { 'nagios_cgi_cfg': @@ -35,12 +36,14 @@ class nagios::base { "puppet:///modules/nagios/configs/cgi.cfg" ], mode => '0644', owner => 'root', group => 0, notify => Service['apache'], + require => Package['nagios'], } file { 'nagios_htpasswd': path => "${nagios::defaults::vars::int_cfgdir}/htpasswd.users", source => [ "puppet:///modules/site_nagios/htpasswd.users", "puppet:///modules/nagios/htpasswd.users" ], + require => Package['nagios'], mode => 0640, owner => root, group => apache; } @@ -53,6 +56,7 @@ class nagios::base { mode => '0750', owner => 'root', group => 'nagios', + require => Package['nagios'], notify => Service['nagios'], } @@ -76,6 +80,7 @@ class nagios::base { purge => true, recurse => true, notify => Service['nagios'], + require => Package['nagios'], mode => '0750', owner => root, group => nagios; } Nagios_command <<||>> @@ -179,6 +184,7 @@ class nagios::base { ensure => file, replace => false, notify => Service['nagios'], + require => Package['nagios'], mode => 0644, owner => root, group => 0; } @@ -190,6 +196,7 @@ class nagios::base { recurse => true, purge => true, notify => Service['nagios'], + require => Package['nagios'], mode => 0755, owner => root, group => root; } } -- cgit v1.2.3