Ask Your Question
0

Exec resource only working during manual run

asked 2018-08-20 02:53:56 -0600

RFrei gravatar image

Hi guys,

I've got an exec resource which prevents a user from getting locked:

  exec {  "disable_user_unlock_${user}":
    command => "usermod -K lock_after_retries=no ${user}",
    path    => "/usr/bin:/usr/sbin/:/bin:/sbin",
  }

When I run puppet agent -t manually the exec resource is working and the command is executed:

Notice: /Stage[main]/Ux_users::Solaris11/Exec[disable_user_unlock_sys]/returns: executed successfully
Notice: Applied catalog in 9.83 seconds

However if puppet is running as a daemon (in my environment every 30min) this resource is not working. Is there something I've overseen or could this be a bug?

Thanks for your help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-27 11:34:44 -0600

binford2k gravatar image

That generally indicates that the command you're running depends on your user login environment somehow. To get a better answer you'll have to explain a lot more than "not working" though!

By the way, you know that command will run every single time Puppet runs, right? Why not create a rights profile and then assign that profile to users as needed?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-08-20 02:53:56 -0600

Seen: 107 times

Last updated: Aug 27