Creating a user (or other type) from hash?

11 views
Skip to first unread message

Kevin Wolf

unread,
Aug 25, 2011, 2:32:25 PM8/25/11
to puppet...@googlegroups.com
Is it possible to create a user from a hash variable?  For example, depending on location, and other factors I need to either set a UID on a user, and possibly set a password, and shell.  If the server is in a different location though, I don't want to set the UID, or a password.

Is it possible to do something like:

$myvar = {
  ensure => present,
  group => ''jboss',
  uid => 901,
  password => pwhash,
}

user{'jboss':
  $myvar
}

This fails at the user definition.

Kevin. 

Adrien Thebo

unread,
Aug 25, 2011, 4:49:51 PM8/25/11
to puppet...@googlegroups.com
Perhaps the create_resources (http://docs.puppetlabs.com/references/2.7.3/function.html#createresources) function is what you're looking for?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/NDyrvi-evY0J.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.



--
Adrien Thebo
Reply all
Reply to author
Forward
0 new messages