From 015b7262e4b0bedad9500e982350197160a4ad1d Mon Sep 17 00:00:00 2001 From: Marcel Haerry Date: Tue, 21 Sep 2010 17:25:49 +0200 Subject: refactor module to the new standard --- manifests/host/cgi.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'manifests/host') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 7fdb281..6fd50df 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -6,11 +6,11 @@ class munin::host::cgi { } file{'/etc/logrotate.d/munin': - source => [ "puppet://$server/files/munin/config/host/${fqdn}/logrotate", - "puppet://$server/files/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/files/munin/config/host/logrotate", - "puppet://$server/munin/config/host/logrotate.$operatingsystem", - "puppet://$server/munin/config/host/logrotate" ], + source => [ "puppet:///modules/site-munin/config/host/${fqdn}/logrotate", + "puppet:///modules/site-munin/config/host/logrotate.$operatingsystem", + "puppet:///modules/site-munin/config/host/logrotate", + "puppet:///modules/munin/config/host/logrotate.$operatingsystem", + "puppet:///modules/munin/config/host/logrotate" ], owner => root, group => 0, mode => 0644; } } -- cgit v1.2.3 From e2dfae5852ecdf3695a6af8ec48092ea24698390 Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Thu, 2 Feb 2012 18:10:14 -0800 Subject: Fully qualify facter variables --- manifests/host/cgi.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests/host') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 6fd50df..283a243 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -6,10 +6,10 @@ class munin::host::cgi { } file{'/etc/logrotate.d/munin': - source => [ "puppet:///modules/site-munin/config/host/${fqdn}/logrotate", - "puppet:///modules/site-munin/config/host/logrotate.$operatingsystem", + source => [ "puppet:///modules/site-munin/config/host/${::fqdn}/logrotate", + "puppet:///modules/site-munin/config/host/logrotate.${::operatingsystem}", "puppet:///modules/site-munin/config/host/logrotate", - "puppet:///modules/munin/config/host/logrotate.$operatingsystem", + "puppet:///modules/munin/config/host/logrotate.${::operatingsystem}", "puppet:///modules/munin/config/host/logrotate" ], owner => root, group => 0, mode => 0644; } -- cgit v1.2.3 From 9fd1de5acd9064a0d67ca9d2c13a829a3f628f39 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 19:39:49 -0300 Subject: new style for 2.7 --- manifests/host/cgi.pp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'manifests/host') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 283a243..9980856 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,16 +1,16 @@ class munin::host::cgi { - exec{'set_modes_for_cgi': - command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', - refreshonly => true, - subscribe => File['/etc/munin/munin.conf.header'], - } + exec{'set_modes_for_cgi': + command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + refreshonly => true, + subscribe => File['/etc/munin/munin.conf.header'], + } - file{'/etc/logrotate.d/munin': - source => [ "puppet:///modules/site-munin/config/host/${::fqdn}/logrotate", - "puppet:///modules/site-munin/config/host/logrotate.${::operatingsystem}", - "puppet:///modules/site-munin/config/host/logrotate", - "puppet:///modules/munin/config/host/logrotate.${::operatingsystem}", - "puppet:///modules/munin/config/host/logrotate" ], - owner => root, group => 0, mode => 0644; - } + file{'/etc/logrotate.d/munin': + source => [ "puppet:///modules/site_munin/config/host/${::fqdn}/logrotate", + "puppet:///modules/site_munin/config/host/logrotate.${::operatingsystem}", + "puppet:///modules/site_munin/config/host/logrotate", + "puppet:///modules/munin/config/host/logrotate.${::operatingsystem}", + "puppet:///modules/munin/config/host/logrotate" ], + owner => root, group => 0, mode => 0644; + } } -- cgit v1.2.3 From fe7b3b5cc614378e9451640d1fa0e125e022b847 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 17 Apr 2013 15:29:34 -0400 Subject: fix dependency on Concat::Fragment['munin.conf.header'], was set to File which would cause this: err: Failed to apply catalog: Could not find dependency File[/etc/munin/munin.conf.header] for Exec[set_modes_for_cgi] at /etc/puppet/modules/munin/manifests/host/cgi.pp:6 --- manifests/host/cgi.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/host') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 9980856..750c72d 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -2,7 +2,7 @@ class munin::host::cgi { exec{'set_modes_for_cgi': command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', refreshonly => true, - subscribe => File['/etc/munin/munin.conf.header'], + subscribe => Concat::Fragment['munin.conf.header'], } file{'/etc/logrotate.d/munin': -- cgit v1.2.3 From a5ce0a9317fc5dd5228cff4c5b6d36366c17b6d5 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 17 Apr 2013 15:53:03 -0400 Subject: setup $::operatingsystem triggered variables for the apache_user and document_root --- manifests/host/cgi.pp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'manifests/host') diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp index 750c72d..0c11d32 100644 --- a/manifests/host/cgi.pp +++ b/manifests/host/cgi.pp @@ -1,8 +1,20 @@ class munin::host::cgi { + + case $::operatingsystem { + debian,ubuntu: { + $apache_user = 'www-data' + $document_root = '/var/www/munin' + } + default: { + $apache_user = 'apache' + $document_root = '/var/www/html/munin' + } + } + exec{'set_modes_for_cgi': - command => 'chgrp apache /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find /var/www/html/munin/* -maxdepth 1 -type d -exec chgrp -R apache {} \; && find /var/www/html/munin/* -maxdepth 1 -type d -exec chmod -R g+w {} \;', + command => "chgrp ${apache_user} /var/log/munin /var/log/munin/munin-graph.log && chmod g+w /var/log/munin /var/log/munin/munin-graph.log && find ${document_root}/* -maxdepth 1 -type d -exec chgrp -R ${apache_user} {} \; && find ${document_root}/* -maxdepth 1 -type d -exec chmod -R g+w {} \;", refreshonly => true, - subscribe => Concat::Fragment['munin.conf.header'], + subscribe => Concat::Fragment['munin.conf.header'], } file{'/etc/logrotate.d/munin': -- cgit v1.2.3