简体   繁体   中英

Error: undefined method `symbolizehash!' for Puppet::Util:Module when using create_resources

If I try to use create_resources like shown in http://docs.puppetlabs.com/references/latest/function.html#createresources :

class foobar
{
  $myusers = {
    'nick' => { uid    => '1330',
                group  => allstaff,
                groups => ['developers', 'operations', 'release'], },
    'dan'  => { uid    => '1308',
                group  => allstaff,
                groups => ['developers', 'prosvc', 'release'], }
  }

  create_resources(user, $myusers)
}

I get this error:

Error: undefined method `symbolizehash!' for Puppet::Util:Module

How do I get this working!?

The code that you've presented isn't a direct copy of the code from the source.

group  => allstaff,

^ that should actually be:

gid    => allstaff,

The thing is, 'group' isn't a valid parameter of the 'User' resource.

Ahh, nevermind; an old module I was using defined #create_resources on it's own..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM