Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exporters: set /usr/bin/nologin as shell #372

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions data/Debian.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
prometheus::env_file_path: '/etc/default'
prometheus::usershell: '/usr/sbin/nologin'
1 change: 1 addition & 0 deletions data/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
prometheus::env_file_path: '/etc/sysconfig'
prometheus::usershell: '/sbin/nologin'
1 change: 1 addition & 0 deletions data/defaults.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
prometheus::usershell: '/usr/bin/nologin'
prometheus::configname: 'prometheus.yaml'
prometheus::service_enable: true
prometheus::service_ensure: 'running'
Expand Down
2 changes: 2 additions & 0 deletions manifests/daemon.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
Stdlib::Host $scrape_host = $facts['fqdn'],
Optional[Stdlib::Port] $scrape_port = undef,
String[1] $scrape_job_name = $name,
Stdlib::Absolutepath $usershell = $prometheus::usershell,
) {

case $install_method {
Expand Down Expand Up @@ -148,6 +149,7 @@
ensure => 'present',
system => true,
groups => $extra_groups,
shell => $usershell,
})

if $manage_group {
Expand Down
5 changes: 5 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@
# Defaults to `undef`, but set to a large integer to override your default OS limit.
# Currently only implemented for systemd based service.
#
# [*usershell*]
# if requested, we create a user for prometheus or the exporters. The default
# shell is nologin. It can be overwritten to any valid path.
#
# Actions:
#
# Requires: see Modulefile
Expand Down Expand Up @@ -193,6 +197,7 @@
Boolean $manage_user,
Optional[String[1]] $extract_command,
Boolean $manage_config,
Stdlib::Absolutepath $usershell,
Hash $extra_alerts = {},
Hash $config_hash = {},
Hash $config_defaults = {},
Expand Down
1 change: 1 addition & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
ensure => 'present',
system => true,
groups => $prometheus::server::extra_groups,
shell => $prometheus::server::usershell,
})

if $prometheus::server::manage_group {
Expand Down
1 change: 1 addition & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
Boolean $manage_config = $prometheus::manage_config,
Optional[Variant[Stdlib::HTTPurl, Stdlib::Unixpath, String[1]]] $external_url = $prometheus::external_url,
Optional[Array[Hash[String[1], Any]]] $collect_scrape_jobs = $prometheus::collect_scrape_jobs,
Stdlib::Absolutepath $usershell = $prometheus::usershell,
) inherits prometheus {

if( versioncmp($version, '1.0.0') == -1 ){
Expand Down