feat: capture all journald logs
All checks were successful
Build / precommit (pull_request) Successful in 3m27s
All checks were successful
Build / precommit (pull_request) Successful in 3m27s
- create module class for journald clients - ensure module class it used on all hosts - use consul service address for insert/journald
This commit is contained in:
parent
1c71229fd3
commit
0d96cfa8fb
@ -358,6 +358,10 @@ networking::route_defaults:
|
|||||||
netmask: 0.0.0.0
|
netmask: 0.0.0.0
|
||||||
network: default
|
network: default
|
||||||
|
|
||||||
|
# logging:
|
||||||
|
victorialogs::client::journald::enable: true
|
||||||
|
victorialogs::client::journald::inserturl: https://vlinsert.service.consul:9428/insert/journald
|
||||||
|
|
||||||
# FIXME these are for the proxmox ceph cluster
|
# FIXME these are for the proxmox ceph cluster
|
||||||
profiles::ceph::client::fsid: 7f7f00cb-95de-498c-8dcc-14b54e4e9ca8
|
profiles::ceph::client::fsid: 7f7f00cb-95de-498c-8dcc-14b54e4e9ca8
|
||||||
profiles::ceph::client::mons:
|
profiles::ceph::client::mons:
|
||||||
|
|||||||
41
modules/victorialogs/manifests/client/journald.pp
Normal file
41
modules/victorialogs/manifests/client/journald.pp
Normal file
@ -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,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
9
modules/victorialogs/templates/client.journald.conf.erb
Normal file
9
modules/victorialogs/templates/client.journald.conf.erb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# This file is managed by Puppet
|
||||||
|
#
|
||||||
|
# See journal-upload.conf(5) for details.
|
||||||
|
|
||||||
|
[Upload]
|
||||||
|
URL=<%= @inserturl %>
|
||||||
|
ServerKeyFile=<%= @serverkeyfile %>
|
||||||
|
ServerCertificateFile=<%= @servercrtfile %>
|
||||||
|
TrustedCertificateFile=<%= @trustedcafile %>
|
||||||
@ -39,6 +39,7 @@ class profiles::base (
|
|||||||
include profiles::cloudinit::init
|
include profiles::cloudinit::init
|
||||||
include profiles::helpers::node_lookup
|
include profiles::helpers::node_lookup
|
||||||
include profiles::consul::client
|
include profiles::consul::client
|
||||||
|
include victorialogs::client::journald
|
||||||
|
|
||||||
# include the python class
|
# include the python class
|
||||||
class { 'python':
|
class { 'python':
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user