From: Peter Palfrader Date: Thu, 22 Aug 2019 08:44:27 +0000 (+0200) Subject: make loghost into a role X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=9130b02a573a992eee25e39efdac3270b968b5ba;p=mirror%2Fdsa-puppet.git make loghost into a role --- diff --git a/hieradata/common.yaml b/hieradata/common.yaml index c7763612e..97c06e3a7 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -374,3 +374,7 @@ roles: - lw08.debian.org anonscm: - cgi-grnet-01.debian.org + loghost: + - loghost-grnet-01.debian.org + - loghost-osuosl-01.debian.org + - lotti.debian.org diff --git a/modules/roles/manifests/init.pp b/modules/roles/manifests/init.pp index 8bc6aa5b9..1837f948c 100644 --- a/modules/roles/manifests/init.pp +++ b/modules/roles/manifests/init.pp @@ -395,4 +395,7 @@ class roles { include roles::anonscm } + if has_role('loghost') { + include syslog_ng::loghost + } } diff --git a/modules/syslog_ng/manifests/init.pp b/modules/syslog_ng/manifests/init.pp index e7a20b630..172c2c7b3 100644 --- a/modules/syslog_ng/manifests/init.pp +++ b/modules/syslog_ng/manifests/init.pp @@ -23,20 +23,6 @@ class syslog_ng { source => 'puppet:///modules/syslog_ng/syslog-ng.logrotate', require => Package['syslog-ng'] } - if $::hostname in [lotti,loghost-grnet-01,loghost-osuosl-01] { - file { '/etc/logrotate.d/syslog-ng-loggers': - source => 'puppet:///modules/syslog_ng/syslog-ng.logrotate.loggers', - require => Package['syslog-ng'] - } - file { '/etc/cron.daily/local-handle-loghost-logs': - ensure => absent, - } - file { '/etc/cron.daily/puppet-handle-loghost-logs': - source => 'puppet:///modules/syslog_ng/loggers-cron', - mode => '0555', - } - } - # while syslog-ng breaks on boot if $systemd { file { '/etc/systemd/system/syslog-ng.service': diff --git a/modules/syslog_ng/manifests/loghost.pp b/modules/syslog_ng/manifests/loghost.pp new file mode 100644 index 000000000..47f4d28d1 --- /dev/null +++ b/modules/syslog_ng/manifests/loghost.pp @@ -0,0 +1,13 @@ +class syslog_ng::loghost { + file { '/etc/logrotate.d/syslog-ng-loggers': + source => 'puppet:///modules/syslog_ng/syslog-ng.logrotate.loggers', + require => Package['syslog-ng'] + } + file { '/etc/cron.daily/puppet-handle-loghost-logs': + source => 'puppet:///modules/syslog_ng/loggers-cron', + mode => '0555', + } + file { '/var/log/.nobackup': + ensure => present, + } +}