[Puppet]Environment variable in epp template

时间:2017-05-31 13:13:31

标签: environment-variables puppet

I'll try use $server_facts['environment'] in epp template, but he dont work correct. My epp code:

<% if $::facts[environment] == 'production' { -%>
# this is production server
<% } else { -%>
# this is NOT production server
<% } -%>

code run without error but always use section after else. Please help fix it.

1 个答案:

答案 0 :(得分:1)

使用后$::facts[agent_specified_environment]完成所有工作正常:

<% if $::facts[agent_specified_environment] == 'production' { -%>
# this is production server
<% } else { -%>
# this is NOT production server
<% } -%>