1
試圖與木偶一起使用hiera。我想知道我怎麼能移動這樣的事情hiera:木偶定義的資源和hiera json
定義:
define apache::namevirtualhost {
$addr_port = $name
# Template uses: $addr_port
concat::fragment { "NameVirtualHost ${addr_port}":
target => $apache::ports_file,
content => template('apache/namevirtualhost.erb'),
}
}
然後在我的super_node.pp:
apache::namevirtualhost { '*:80': }
我怎麼會動「*:80 'hiera json文件?像這樣的東西(似乎不工作):
{
"apache::namevirtualhost" : "*:80"
}
同樣的問題,如果我有定義多次,我怎麼能移動的配置hiera:
vagrant::box { 'dev.local':
sshport => '2223',
ip => '10.69.69.101'
}
vagrant::box { 'it.local':
sshport => '2224',
ip => '10.69.69.102'
}
你有測試你的答案?:你的建議的「阿帕奇:: {了NameVirtualHost hiera(‘阿帕奇::了NameVirtualHost’ ):}'給我「錯誤:無法解析環境生成:':'處的語法錯誤;預期'}'「 – gerasalus
我很抱歉,但實際上我無法檢查語法,也許木偶不喜歡'resource {foo():}'語法,但是hiera調用是打印的,並且會盡可能命令行'hiera variablename'呢。 –