Ask Your Question

Multiple user creation through puppet...

asked 2015-04-13 23:58:13 -0500

Rajeeshu gravatar image

We need to create multiple users in my linux enviroment. What is the best way to do this? Idea is not to mention the user and key values in the manifest but calling from a params file or hiera. Any help is appreciated..

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-04-15 00:18:57 -0500

GregLarkin gravatar image

You can list all of your users in an array in your Hiera data file, then do something like this in your manifest:

# Hiera data
  - user1
  - user2
  - user3

# Puppet manifest
$userlist = hiera('userlist')

user { $userlist:
  ensure => present,

If you need more flexibility, have a look at the create_resources function. Then you can specify a hash in your Hiera data file that includes usernames as well as all other parameters that you want to control for each user.

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


Asked: 2015-04-13 23:58:13 -0500

Seen: 818 times

Last updated: Apr 15 '15