Vagrant 傀儡语法错误
接收到以下错误Vagrant 傀儡语法错误,vagrant,puppet,Vagrant,Puppet,接收到以下错误错误:无法分析环境产品:conf处的语法错误;尝试验证以下init.pp 我已经浏览了我的课程,似乎我所有的逗号和冒号都是有序的,所以我不确定这是怎么回事。至于我的流浪汉档案 class haproxy { class { 'haproxy::install': $conf = '/etc/sysconfig/network' $seed = '11.111.111' ## IP Seed $interfaces = {
错误:无法分析环境产品:conf处的语法错误;尝试验证以下init.pp
我已经浏览了我的课程,似乎我所有的逗号和冒号都是有序的,所以我不确定这是怎么回事。至于我的流浪汉档案
class haproxy {
class { 'haproxy::install':
$conf = '/etc/sysconfig/network'
$seed = '11.111.111' ## IP Seed
$interfaces = { ## Generate IPConfigs based on Generic IP Variable
'eth0' => "${seed}.140",
'eth0:0' => "${seed}.141",
'eth0:1' => "${seed}.142",
}
ini_setting { 'networking':
ensure => present,
section => '',
setting => 'NETWORKING',
value => 'yes',
path => $conf,
} ->
ini_setting { 'hostname':
ensure => present,
section => '',
setting => 'HOSTNAME',
value => $::fqdn,
path => $conf,
} ->
ini_setting { 'gateway':
ensure => present,
section => '',
setting => 'GATEWAY',
value => "${seed}.1",
path => $conf,
} ->
## Clone to ifcfg-eth0:0 and ifcfg-eth0:1
file { '/etc/sysconfig/network-scripts/ifcfg-eth0':
ensure => present,
source => '/etc/sysconfig/network-scripts/ifcfg-eth0:{0,1}',
}
## Puppet Lambda's
## REF: http://goo.gl/qFj611
## TRY:
## REQ: the puppet apply --parser=future flag
each($interfaces) |$device, $ipaddress| {
file { 'interfaces':
ensure => link,
target => "/etc/sysconfig/network-scripts/ifcfg-${device}",
content => template('interfaces.erb'),
}
}
}
}
如果有人在乎的话
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = 'Oracle-6.6_Puppet-slave'
config.vm.box_url = 'boxes/Oracle-6.6_Puppet-slave.box'
config.vm.provision :puppet do |puppet|
puppet.options = '--parser future' ## Future parser required for iteration
puppet.options = '--hiera_config /vagrant/generic/hiera.yaml' ## Silence...
puppet.manifests_path = 'manifests'
puppet.manifest_file = 'default.pp'
puppet.module_path = 'modules'
end
end
这是修复方法,从
class haproxy {
class { 'haproxy::install':
$conf = '/etc/sysconfig/network'
$seed = '11.111.111' ## IP Seed
$interfaces = { ## Generate IPConfigs based on Generic IP Variable
'eth0' => "${seed}.140",
'eth0:0' => "${seed}.141",
'eth0:1' => "${seed}.142",
}
到
class haproxy::install {
$conf = '/etc/sysconfig/network'
$seed = '11.111.111' ## IP Seed
$interfaces = { ## Generate IPConfigs based on Generic IP Variable
'eth0' => "${seed}.140",
'eth0:0' => "${seed}.141",
'eth0:1' => "${seed}.142",
}