On Jun 1, 8:49 am, GriffaA10 <[email protected]> wrote:
> The overhead of explicity realising the resources would be too great.
>
> Specifically what I am trying to achive is disabling accounts on existing
> hosts, while preventing them from being created when new hosts are turned
> up. So when a user leaves the company the account would be disabled by
> locking the password and disabling the shell, and if new host was turned up
> tomorrow I would not want the account created there.
The only straightforward (but hackish) way I see to achieve this is
with an Exec
and onlyif (probably wrapped in a define):
define dead_user($username) {
exec { "remove-user-${username}":
onlyif => "/usr/bin/getent passwd ${username} >/dev/null",
command => "/usr/sbin/usermod ... ${username}",
}
}
Another possibility would be to make a fact that returns all of users
on a
system and do something with that--maybe returns a colon-delimited
list and
uses the 'split' function and the 'member' function from stdlib.
Wil
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.