feat: capture all journald logs (#377)
- create module class for journald clients - ensure module class it used on all hosts - use consul service address for insert/journald Reviewed-on: #377
This commit was merged in pull request #377.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
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,
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user