Skip to content

Commit

Permalink
Merge pull request #831 from /issues/548
Browse files Browse the repository at this point in the history
manage homedirectory for prometheus user when manage_user is true
  • Loading branch information
bastelfreak authored Dec 30, 2024
2 parents a5ccb71 + 4a05371 commit 76b9e76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
system => true,
groups => $prometheus::server::extra_groups,
shell => $prometheus::server::usershell,
managehome => true,
home => $prometheus::server::localstorage,
})

if $prometheus::server::manage_group {
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/prometheus_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
it { is_expected.to contain_class('prometheus::server') }
it { is_expected.to contain_class('prometheus::service_reload') }

if facts[:os]['name'] != 'Archlinux'
it {
is_expected.to contain_user('prometheus').with(
'ensure' => 'present',
'system' => true,
'groups' => [],
'managehome' => true,
'home' => '/var/lib/prometheus'
)
}
end

if facts[:os]['name'] == 'Archlinux'
it { expect(subject).not_to contain_file('/var/lib/prometheus') }
else
Expand Down

0 comments on commit 76b9e76

Please sign in to comment.