-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #482 from cirrax/dev_journal
add support for journal upload and remote server
- Loading branch information
Showing
9 changed files
with
311 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
--- | ||
systemd::nspawn_package: 'systemd-container' | ||
systemd::journal_upload::package_name: 'systemd-journal-remote' | ||
systemd::journal_remote::package_name: 'systemd-journal-remote' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# @api private | ||
# @summary This class manages and configures journal-remote. | ||
# @see https://www.freedesktop.org/software/systemd/man/journal-remote.conf.html | ||
# | ||
# @param package_name | ||
# name of the package to install for the functionality | ||
# | ||
class systemd::journal_remote ( | ||
Optional[String[1]] $package_name = undef, | ||
) { | ||
assert_private() | ||
|
||
if $package_name { | ||
stdlib::ensure_packages($package_name) | ||
} | ||
|
||
service { 'systemd-journal-remote': | ||
ensure => running, | ||
enable => true, | ||
} | ||
$systemd::journal_remote_settings.each |$option, $value| { | ||
ini_setting { "journal-remote_${option}": | ||
path => '/etc/systemd/journal-remote.conf', | ||
section => 'Remote', | ||
setting => $option, | ||
notify => Service['systemd-journal-remote'], | ||
} | ||
if $value =~ Systemd::JournaldSettings::Ensure { | ||
Ini_setting["journal-remote_${option}"] { | ||
* => $value, | ||
} | ||
} else { | ||
Ini_setting["journal-remote_${option}"] { | ||
value => $value, | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# @api private | ||
# @summary This class manages and configures journal-upload. | ||
# @see https://www.freedesktop.org/software/systemd/man/journald.conf.html | ||
# | ||
# @param package_name | ||
# name of the package to install for the functionality | ||
# | ||
# @param service_ensure | ||
# what we ensure for the service | ||
# | ||
# @param service_enable | ||
# to enable the service | ||
# | ||
class systemd::journal_upload ( | ||
Optional[String[1]] $package_name = undef, | ||
Enum['running','stopped'] $service_ensure = 'running', | ||
Boolean $service_enable = true, | ||
) { | ||
assert_private() | ||
|
||
if $package_name { | ||
stdlib::ensure_packages($package_name) | ||
} | ||
|
||
service { 'systemd-journal-upload': | ||
ensure => $service_ensure, | ||
enable => $service_enable, | ||
} | ||
$systemd::journal_upload_settings.each |$option, $value| { | ||
ini_setting { "journal-upload_${option}": | ||
path => '/etc/systemd/journal-upload.conf', | ||
section => 'Upload', | ||
setting => $option, | ||
notify => Service['systemd-journal-upload'], | ||
} | ||
if $value =~ Systemd::JournaldSettings::Ensure { | ||
Ini_setting["journal-upload_${option}"] { | ||
* => $value, | ||
} | ||
} else { | ||
Ini_setting["journal-upload_${option}"] { | ||
value => $value, | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# @summary matches Systemd journal remote config Struct | ||
type Systemd::JournalRemoteSettings = Struct[ | ||
# lint:ignore:140chars | ||
{ | ||
Optional['Seal'] => Variant[Enum['yes','no'],Systemd::JournaldSettings::Ensure], | ||
Optional['SplitMode'] => Variant[Enum['host','none'],Systemd::JournaldSettings::Ensure], | ||
Optional['ServerKeyFile'] => Variant[Stdlib::Unixpath,Systemd::JournaldSettings::Ensure], | ||
Optional['ServerCertificateFile'] => Variant[Stdlib::Unixpath,Systemd::JournaldSettings::Ensure], | ||
Optional['TrustedCertificateFile'] => Variant[Stdlib::Unixpath,Systemd::JournaldSettings::Ensure], | ||
Optional['MaxUse'] => Variant[Systemd::Unit::Amount,Systemd::JournaldSettings::Ensure], | ||
Optional['KeepFree'] => Variant[Systemd::Unit::Amount,Systemd::JournaldSettings::Ensure], | ||
Optional['MaxFileSize'] => Variant[Systemd::Unit::Amount,Systemd::JournaldSettings::Ensure], | ||
Optional['MaxFiles'] => Variant[Integer,Systemd::JournaldSettings::Ensure], | ||
} | ||
# lint:endignore | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# @summary matches Systemd journal upload config Struct | ||
type Systemd::JournalUploadSettings = Struct[ | ||
# lint:ignore:140chars | ||
{ | ||
Optional['URL'] => Variant[Stdlib::HTTPUrl,Systemd::JournaldSettings::Ensure], | ||
Optional['ServerKeyFile'] => Variant[Stdlib::Unixpath,Systemd::JournaldSettings::Ensure], | ||
Optional['ServerCertificateFile'] => Variant[Stdlib::Unixpath,Systemd::JournaldSettings::Ensure], | ||
Optional['TrustedCertificateFile'] => Variant[Stdlib::Unixpath,Systemd::JournaldSettings::Ensure], | ||
Optional['NetworkTimeoutSec'] => Variant[Systemd::Unit::Timespan,Systemd::JournaldSettings::Ensure], | ||
} | ||
# lint:endignore | ||
] |