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

The module should have manage_home => true for user #548

Open
samuraiii opened this issue May 4, 2021 · 1 comment
Open

The module should have manage_home => true for user #548

samuraiii opened this issue May 4, 2021 · 1 comment
Assignees

Comments

@samuraiii
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: does not matter
  • Ruby:
  • Distribution: Centos 7 (but I bet is not the only one)
  • Module version: 11.1.0

How to reproduce (e.g Puppet code you use)

When you setup a cron for the prometheus user all is alright up to the time when the cronjob should be runnig.
It fails with

May 04 09:49:01 prometheus CROND[8958]: (CRON) ERROR chdir failed (/home/prometheus): No such file or directory

And this indicates that there is no home dir for the prometheus user.

Puppet example:

cron {
   'send date to /tmp/test':
        command => '/bin/date > /tmp/test',
        user           =>$prometheus::server::user;
}

this should change content of the /tmp/test every minute, but it does not happen due to the mentioned error.

Cheers
S

PS: also the home for system users should not be in the /home directory.

@samuraiii
Copy link
Author

samuraiii commented May 4, 2021

suggested fix in install.pp

  if $prometheus::server::manage_user {
    ensure_resource('user', [$prometheus::server::user], {
        ensure     => 'present',
        system     => true,
        groups     => $prometheus::server::extra_groups,
        shell      => $prometheus::server::usershell,
        managehome => true,
        home       => $prometheus::server::localstorage,
    })

@TheMeier TheMeier self-assigned this May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants