- create module class for journald clients - ensure module class it used on all hosts - use consul service address for insert/journald Reviewed-on: #377
42 lines
1.1 KiB
Puppet
42 lines
1.1 KiB
Puppet
class victorialogs::client::journald (
|
|
Boolean $enable = false,
|
|
Stdlib::HTTPUrl $inserturl = 'http://localhost:9428/insert/journald',
|
|
Stdlib::Absolutepath $serverkeyfile = '/etc/pki/tls/vault/private.key',
|
|
Stdlib::Absolutepath $servercrtfile = '/etc/pki/tls/vault/certificate.crt',
|
|
Stdlib::Absolutepath $trustedcafile = '/etc/pki/tls/certs/ca-bundle.crt',
|
|
){
|
|
|
|
if $enable {
|
|
package {'systemd-journal-remote':
|
|
ensure => installed,
|
|
notify => Service['systemd-journal-upload']
|
|
}
|
|
|
|
file {'/etc/systemd/journal-upload.conf.d/':
|
|
ensure => directory,
|
|
owner => 'root',
|
|
group => 'root'
|
|
}
|
|
|
|
file {'/etc/systemd/journal-upload.conf.d/victorialogs.conf':
|
|
ensure => file,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0644',
|
|
content => template('victorialogs/client.journald.conf.erb')
|
|
}
|
|
|
|
service {'systemd-journal-upload':
|
|
ensure => true,
|
|
enable => true,
|
|
subscribe => File['/etc/systemd/journal-upload.conf.d/victorialogs.conf'],
|
|
}
|
|
}else{
|
|
|
|
file {'/etc/systemd/journal-upload.conf.d/victorialogs.conf':
|
|
ensure => absent,
|
|
}
|
|
|
|
}
|
|
}
|