License: Attribution-NonCommercial-ShareAlike 4.0 International
本文出自 Suzf Blog。 如未注明,均为 SUZF.NET 原创。
转载请注明:http://suzf.net/post/599
puppet templates follow the erb templating standard.
The puppet documentation contains an example of how to do a simple if statement.
<% if broadcast != "NONE" %> broadcast <%= broadcast %> <% end %>
To do an if/else statement, simply add <% else %>
<% if @someclass::someparameter != true %> bar = 42 <% else %> bar = 0 <% end %>
-- for dynamic content use: <%= %>
-- for another content use: <% %>
-- eg: <% if 1>2 %>
http://stackoverflow.com/questions/6932663/whats-wrong-with-my-simple-if-else
https://docs.puppetlabs.com/puppet/latest/reference/lang_template_erb.html