Librarian Puppet - nil:NilClass 的未定义方法“map”(默认值:NoMethodError)
Librarian Puppet - Undefined method `map' for nil:NilClass (default: NoMethodError)
虽然使用 librarian-puppet
使用 arpitaggarwal/tomcat module from Puppet Forge 配置 Vagrant
VM 对我来说 Puppetfile
中的内容如下:
人偶文件:
forge "http://forge.puppetlabs.com"
mod "puppetlabs/apt"
mod 'tomcat', :git => 'https://github.com/arpitaggarwal/tomcat.git'
而且,当我将 PuppetFile
内容编辑为:
forge "http://forge.puppetlabs.com"
mod "puppetlabs/apt"
mod "arpitaggarwal/tomcat"
我收到一个错误:
==> default: /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:29:in `versions'
==> default: :
==> default: undefined method `map' for nil:NilClass
==> default: (
==> default: NoMethodError
==> default: )
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:43:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:312:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `map'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/dependency.rb:117:in `cache_manifests!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/dependency.rb:113:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:70:in `recursive_resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:154:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:187:in `scope_checking_manifest'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:186:in `scope_checking_manifest'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:153:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:211:in `map_find'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `each'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `map_find'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:50:in `resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver.rb:23:in `resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/action/resolve.rb:26:in `run'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:169:in `resolve!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/cli.rb:69:in `install'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/command.rb:27:in `__send__'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:31:in `returning_status'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:47:in `with_environment'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/bin/librarian-puppet:7
==> default: from /opt/vagrant_ruby/bin/librarian-puppet:19:in `load'
==> default: from /opt/vagrant_ruby/bin/librarian-puppet:19
知道如何解决吗?
能否详细说明如何安装librarian-puppet
我有一个安装它的脚本(基于 this one),它安装得很好
manifests/init.pp
class { 'tomcat': }
人偶文件
forge "http://forge.puppetlabs.com"
mod "puppetlabs/apt"
mod "arpitaggarwal/tomcat"
vagrant up
的输出
==> default: Running provisioner: puppet...
==> default: Running Puppet with main.pp...
==> default: stdin: is not a tty
==> default: Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
==> default: Notice: /Stage[main]/Tomcat/Exec[apt-update]/returns: executed successfully
==> default: Notice: /Stage[main]/Tomcat/Package[tomcat7]/ensure: ensure changed 'purged' to 'present'
==> default: Notice: /Stage[main]/Tomcat/File[/etc/default/tomcat7]/content: content changed '{md5}49f3fe5de425aca649e2b69f4495abd2' to '{md5}2694682a4593e8d185d428f6bdeb39e2'
==> default: Notice: /Stage[main]/Tomcat/File[/etc/tomcat7/server.xml]/content: content changed '{md5}523967040584a921450af2265902568d' to '{md5}676faee02c60f2e593530339cadf4791'
==> default: Notice: /Stage[main]/Tomcat/Exec[service-restart]/returns: executed successfully
==> default: Notice: Finished catalog run in 389.24 seconds
Tomcat 已安装并在 VM 上
vagrant@precise64:~$ librarian-puppet version
librarian-puppet v1.5.0
vagrant@precise64:~$
上一个答案
我认为在较新版本的图书管理员中,您需要使用 forge "https://forgeapi.puppetlabs.com"
虽然使用 librarian-puppet
使用 arpitaggarwal/tomcat module from Puppet Forge 配置 Vagrant
VM 对我来说 Puppetfile
中的内容如下:
人偶文件:
forge "http://forge.puppetlabs.com"
mod "puppetlabs/apt"
mod 'tomcat', :git => 'https://github.com/arpitaggarwal/tomcat.git'
而且,当我将 PuppetFile
内容编辑为:
forge "http://forge.puppetlabs.com"
mod "puppetlabs/apt"
mod "arpitaggarwal/tomcat"
我收到一个错误:
==> default: /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:29:in `versions'
==> default: :
==> default: undefined method `map' for nil:NilClass
==> default: (
==> default: NoMethodError
==> default: )
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:43:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/source/forge.rb:312:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `map'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:16:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/dependency.rb:117:in `cache_manifests!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/dependency.rb:113:in `manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:70:in `recursive_resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:154:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:187:in `scope_checking_manifest'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:186:in `scope_checking_manifest'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:153:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:211:in `map_find'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `each'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:210:in `map_find'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:152:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:165:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:179:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:178:in `scope_checking_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:164:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:223:in `scope'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:163:in `scope_resolving_dependency'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:151:in `resolving_dependency_map_find_manifests'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:62:in `recursive_resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver/implementation.rb:50:in `resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/resolver.rb:23:in `resolve'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/action/resolve.rb:26:in `run'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:169:in `resolve!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/lib/librarian/puppet/cli.rb:69:in `install'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/command.rb:27:in `__send__'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:31:in `returning_status'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:47:in `with_environment'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-0.1.2/lib/librarian/cli.rb:26:in `bin!'
==> default: from /opt/vagrant_ruby/lib/ruby/gems/1.8/gems/librarian-puppet-1.0.0/bin/librarian-puppet:7
==> default: from /opt/vagrant_ruby/bin/librarian-puppet:19:in `load'
==> default: from /opt/vagrant_ruby/bin/librarian-puppet:19
知道如何解决吗?
能否详细说明如何安装librarian-puppet
我有一个安装它的脚本(基于 this one),它安装得很好
manifests/init.pp
class { 'tomcat': }
人偶文件
forge "http://forge.puppetlabs.com"
mod "puppetlabs/apt"
mod "arpitaggarwal/tomcat"
vagrant up
==> default: Running provisioner: puppet...
==> default: Running Puppet with main.pp...
==> default: stdin: is not a tty
==> default: Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
==> default: Notice: /Stage[main]/Tomcat/Exec[apt-update]/returns: executed successfully
==> default: Notice: /Stage[main]/Tomcat/Package[tomcat7]/ensure: ensure changed 'purged' to 'present'
==> default: Notice: /Stage[main]/Tomcat/File[/etc/default/tomcat7]/content: content changed '{md5}49f3fe5de425aca649e2b69f4495abd2' to '{md5}2694682a4593e8d185d428f6bdeb39e2'
==> default: Notice: /Stage[main]/Tomcat/File[/etc/tomcat7/server.xml]/content: content changed '{md5}523967040584a921450af2265902568d' to '{md5}676faee02c60f2e593530339cadf4791'
==> default: Notice: /Stage[main]/Tomcat/Exec[service-restart]/returns: executed successfully
==> default: Notice: Finished catalog run in 389.24 seconds
Tomcat 已安装并在 VM 上
vagrant@precise64:~$ librarian-puppet version
librarian-puppet v1.5.0
vagrant@precise64:~$
上一个答案
我认为在较新版本的图书管理员中,您需要使用 forge "https://forgeapi.puppetlabs.com"