Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
628a3dc
fix: use systemd::unit_file for service
Aug 23, 2021
7c3684e
fix: wait until restarting service
Aug 23, 2021
8144493
fix: notify service-install when files changed
Aug 23, 2021
d9353d4
fix: restart correct service when updating config
Aug 23, 2021
c2d1e06
fix: add Start-Limit Burst for Promtail
Aug 23, 2021
ac83b6f
feat: implement support for windows
Sep 16, 2021
ebc2114
fix: convert to string type
Sep 16, 2021
ec25d16
fix: add supported architecture 'x64'
Sep 16, 2021
a908547
fix: actually use absolute-path type
Sep 16, 2021
7b06435
fix: install windows service correctly before using service class
Sep 16, 2021
810743a
fix: correctly register service
Sep 17, 2021
c20d9f6
fix: remove New-Service definition in promtail::service class
Sep 17, 2021
7cd029a
fix: remove unused require of the installed service
Sep 17, 2021
02f5cb8
Revert "fix: remove unused require of the installed service"
Sep 17, 2021
3eaf2a6
Revert "fix: remove New-Service definition in promtail::service class"
Sep 17, 2021
bc0a286
fix(service): install windows service with sc.exe
Sep 18, 2021
1161f52
fix: install and manage service with sc.exe only
Sep 18, 2021
633a89b
fix: hopefully install service correctly
Sep 20, 2021
b977bad
fix: actual install promtail windows service
Sep 20, 2021
35f1024
fix: install windows service as automatic startup
Sep 20, 2021
5b73154
fix: path of service for installation
Sep 20, 2021
cf50843
fix: mistyping in hiera.yaml
Sep 20, 2021
1ca3a88
feat: add support of windows to metadata
Sep 20, 2021
114ac66
fix: use nssm package to support windows service
Sep 20, 2021
f890bce
fix: add correct ensure state to nssm::service definition
Sep 20, 2021
79bfb86
fix: require nssm package
Sep 20, 2021
924d350
fix: how config path is given to nssm::service definition
Sep 20, 2021
e647edb
fix: update required nssm package
Sep 20, 2021
e5158a7
fix: app parameter to enquote the config path
Sep 20, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions files/promtail.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ Description=Promtail agent from Grafana
Documentation=https://github.com/grafana/loki/tree/master/docs/clients/promtail
After=network.target

StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/local/bin/promtail -config.file=/etc/promtail/config.yaml
ExecReload=/bin/kill -HUP $MAINPID

Restart=on-failure
RestartSec=2s
RestartForceExitStatus=SIGPIPE
KillMode=control-group

Expand Down
2 changes: 1 addition & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

concat { $config_file:
ensure => present,
notify => Service['promtail'],
notify => Systemd::Unit_file['promtail.service'],
}

concat::fragment { 'config_header':
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
ensure => link,
target => $binary_path,
require => File[$binary_path],
notify => Service['promtail'],
notify => Systemd::Unit_file['promtail.service'],
;
}
}
11 changes: 4 additions & 7 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
class promtail::service {
case $facts['kernel'] {
'Linux': {
include systemd::systemctl::daemon_reload
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this resource is gone in latest releases of the systemd module. The module now requires puppet 6.1 or newer because that version contains the automatic systemctl daemon-reload und changed/new unit files.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module already states 6.1 as the bottom end so I think removing this would make sense.

systemd::unit_file { 'promtail.service':
ensure => present,
source => 'puppet:///modules/promtail/promtail.service',
notify => Service['promtail'],
}

service { 'promtail':
ensure => $promtail::service_ensure,
enable => $promtail::service_enable,
require => Systemd::Unit_file['promtail.service'],
enable => $promtail::service_enable,
active => $promtail::service_ensure == 'running'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the syntax <3

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with this syntax @bastelfreak, what does it do and why do you <3 it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe because it's readable?

}
}
default: { fail("${facts['kernel']} is not supported") }
Expand Down