简体   繁体   English

错误:未定义的方法'symbolizehash!' 使用create_resources时用于Puppet :: Util:Module

[英]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 : 如果我尝试使用http://docs.puppetlabs.com/references/latest/function.html#createresources中所示的create_resources:

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.. 我自己使用定义的#create_resources的旧模块。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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