我在Google Compute引擎中使用Puppet自动化实例。我安装了必要的gcloud工具并使用“puppet apply new-ins.pp
”运行清单文件但由于收到错误而无法成功执行
无法评估:[/ dev / null]:是无效的
无法评估:第3行无效:url [/ dev / null]:
我需要在device.conf
档案new-ins.pp
:
gce_instance { 'puppet-test':
ensure => present,
description => 'A Puppet test',
machine_type => 'n1-standard-1',
zone => 'us-central1-a',
network => 'default',
image => 'projects/centos-cloud/global/images/centos-6-v20131120',
tags => ['puppet', 'pp-master'],
startupscript => 'puppet-enterprise.sh',
metadata => {
'pe_role' => 'master',
'pe_version' => '3.3.1',
'pe_consoleadmin' => 'arunp7080@gmail.com',
'pe_consolepwd' => 'puppetize',
},
service_account_scopes => ['compute-ro'],
}
这是我得到的输出:
Error: /Stage[main]/Main/Gce_instance[puppet-test]: Could not evaluate: Invalid line 3: url[/dev/null]:
/usr/lib/ruby/site_ruby/1.8/puppet/util/network_device/config.rb:65:in `parse'
/usr/lib/ruby/site_ruby/1.8/puppet/util/network_device/config.rb:44:in `each'
/usr/lib/ruby/site_ruby/1.8/puppet/util/network_device/config.rb:44:in `parse'
/usr/lib/ruby/site_ruby/1.8/puppet/util/network_device/config.rb:42:in `open'
/usr/lib/ruby/site_ruby/1.8/puppet/util/network_device/config.rb:42:in `parse'
/usr/lib/ruby/site_ruby/1.8/puppet/util/network_device/config.rb:33:in `read'
/usr/lib/ruby/site_ruby/1.8/puppet/util/network_device/config.rb:26:in `initiali
答案 0 :(得分:2)
我自己也遇到了这个问题。似乎从Puppet 3.7.5
开始有额外的URI验证https://github.com/puppetlabs/puppet/blob/3.7.5/lib/puppet/util/network_device/config.rb#L86
为了解决这个问题,我暂时在本地版本中注释了验证规则...