我有这样的清单:
$foremanlogin = file('/etc/puppetlabs/code/environments/production/manifests/foremanlogin.txt')
$foremanpass = file('/etc/puppetlabs/code/environments/production/manifests/foremanpass.txt')
$query = foreman({foreman_user => "$foremanlogin",
foreman_pass => "$foremanpass",
item => 'hosts',
search => 'hostgroup = "Web Servers"',
filter_result => 'name',
})
$quoted = regsubst($query, '(.*)', '"\1"')
$query6 = join($quoted, ",")
notify{"The value is: ${query6}": }
node ${query6} {
package { 'atop':
ensure => 'installed',
}
}
当我执行这个代理上我得到了错误:
Server Error: Could not parse for environment production: Syntax error at ''
错误在我的节点块
node ${query6} {
package { 'atop':
ensure => 'installed',
}
}
我看到通知正确的输出,我的变量是这样的:
"test-ubuntu1","test-ubuntu2"
变量正确的节点清单的格式。
我不什么错明白吗? 可变query6是正确的。
如何解决呢?