There are at least three kinds of problems there:
- resource names in resource references should be capitalized. For example:
"require => [ User[$uname] ]"
- you are trying to pass parameters (jeckman, saga, sandipb, and vartika) to non-parametrized class 'users'.
- your class 'users' is passing a previously-undefined variable $users to the create_resources function
The quickest fix to get this working would probably be to add a parameter $users to class users, and to update your ENC to wrap the individual user hashes ('jeckman', etc.) in an outer hash 'users':
classes:
users:
users:
jeckman:
comment: Jack
gid: 100
[...]
That says class "users" should be assigned to the node, and the value of its parameter "users" should be the specified hash of hashes.
With that said, I have to add that you probably should not be fiddling with an ENC as you first start out. Small sites rarely get much advantage from an ENC, and few indeed are the sites that will benefit from a custom-built one. Additionally, I generally advise everyone to avoid parametrized classes. They introduce pitfalls that newbies generally are not equipped to recognize or appreciate.
If you want to define data, such as user properties, outside your Puppet manifests then do look into adding Hiera to your puppetmaster. That's Puppetlabs chosen direction. With hiera you use a Puppet function to load your data instead of feeding it in via a parameter. (Puppet 3 will allow you to combine class parameters with data lookup, but it's not quite ready for release yet.)
John