Skip to content

Commit

Permalink
Merge pull request voxpupuli#372 from bastelfreak/arch5
Browse files Browse the repository at this point in the history
exporters: set /usr/bin/nologin as shell
  • Loading branch information
bastelfreak authored Sep 23, 2019
2 parents 74f52b1 + 420a863 commit 96abbd4
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
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

0 comments on commit 96abbd4

Please sign in to comment.