Hi Manuela,
On 30 Mar 2016, at 12:51, 'Manuela Mueller' via Puppet Users <
puppet...@googlegroups.com> wrote:
> Dear All,
>
> I'm trying to set up a small module in order to test defined resource types. Module should create 2 users, data are in host specific yaml file pieps.yaml.
> When I try to apply the module I receive the following error message:
>
> [root@pieps modules]# puppet apply --noop --modulepath=./ deftype_users_test/tests/init.pp
> Error: Evaluation Error: The value 'name' cannot be converted to Numeric. at /root/Desktop/testing/modules/deftype_users_test/manifests/init.pp:3:40 on node pieps.localdomain
>
> As I'm just beginning to learn Puppet, I have no idea where the error is.
> Any help would be greatly appreciated.
>
> Thank you very much and have a nice day,
>
> Manula Atoui
You want Puppet to do automatic data lookup for the class ‘deftype_users_test’ parameter.
In this case the hiera key has to follow naming convention:
<classname>::<parametername>
in your case:
deftyp_users_test::user list:
‘jill’:
uid: 1000
‘jack’:
uid: 1001
Within your puppet class you iterate over the hash:
class deftype_users_test (
Hash $userlist
){
$userlist.each | String $key, Hash $value| {
notify { “User with name: ${key} and hid ${value[uid]}”: }
}
}
hth,
Martin
> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
puppet-users...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/cb8fcf42-80a7-499e-841d-5bda1b3a2369%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.