Compare commits

...

2 commits

Author SHA1 Message Date
fa0ca96e3f
Test rsyslog::client class 2025-02-21 13:24:58 +01:00
b4e5895af8
Added soc::rsyslog::client class 2025-02-21 13:23:21 +01:00
2 changed files with 55 additions and 0 deletions

View file

@ -36,6 +36,7 @@
proxy: 'https://test-sso-proxy1.cert.sunet.se/idp'
entity_id: 'https://test-sso-proxy.cert.sunet.se/idp'
soc::vuln_dashboard:
soc::rsyslog::client:
'^internal-sto3-dev-ci-1.cert.sunet.se$':
sunet::dockerhost2:

View file

@ -0,0 +1,54 @@
# rsyslog
class soc::rsyslog::client(
$daily_rotation = true,
$syslog_servers = lookup(syslog_servers, undef, undef, []),
$relp_syslog_servers = lookup(relp_syslog_servers, undef, undef, ['89.45.237.247:2514']),
$syslog_enable_remote = lookup('syslog_enable_remote', undef, undef, 'true'),
) {
# Install rsyslog packages
[ 'rsyslog', 'rsyslog-relp', 'rsyslog-openssl' ].each |String $package| {
package { $package:
ensure => latest,
}
}
$do_remote = str2bool($syslog_enable_remote)
file {
'/etc/rsyslog.conf':
ensure => file,
mode => '0644',
content => template('soc/rsyslog/rsyslog.conf.erb'),
require => Package['rsyslog'],
notify => Service['rsyslog'],
;
'/etc/rsyslog.d/50-default.conf':
ensure => file,
mode => '0644',
content => template('soc/rsyslog/rsyslog-default.conf.erb'),
require => Package['rsyslog'],
notify => Service['rsyslog'],
;
'/etc/rsyslog.d/60-remote.conf':
ensure => file,
mode => '0644',
content => template('soc/rsyslog/rsyslog-remote.conf.erb'),
require => Package['rsyslog'],
;
}
service { 'rsyslog':
ensure => 'running',
enable => true,
subscribe => File['/etc/rsyslog.d/60-remote.conf'],
}
if ($daily_rotation == true)
{
file { '/etc/logrotate.d/rsyslog':
ensure => file,
mode => '0644',
content => template('soc/rsyslog/rsyslog.logrotate.erb'),
}
}
}