MCZ
2013-Jan-24 14:26 UTC
[Puppet Users] can''t convert nil into Hash with create_resource and +>
I am doing something like that: class users::userlist { @users::virtual::localuser { "ubuntu": sshkey => { ''test_key'' => { key => ''XX'' }, ''test_key2'' => { key => ''YY''}, ,} groups => ''test_group'', } } All is good whenever I just do realize(Users::Virtual::Localuser[''ubuntu'']), but lets say I would like to append some more keys later on in another subclass, class users::specific inherits users:userlist { realize (Users::Virtual::Localuser[''ubuntu'']) Users::Virtual::Localuser[''ubuntu''] { sshkey +> { ''test_key3'' +> { key => ''ZZ''}, } } } *I am getting: Error 400 on SERVER: can''t convert nil into Hash at _create_resources invocation_* The way I am propagating keys: define localuser ($groups,$pass,$sshkey="",$homedir="/home/$title") (...) CUT HERE (...) $sshuser = { ''user'' => $title } if ( $sshkey != "" ) { create_resources(users::virtual::sshkeys,$sshkey,$sshuser) } $sshuser = { ''user'' => $title } define sshkeys($key,$user,$state=''present'') { ssh_authorized_key { "${title}_${user}": ensure => "$state", type => "ssh-rsa", key => $key, user => "$user", require => User["$user"], name => "$title", } } Ideas? -- 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/-/wBHDxuSynp4J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.