Skip to content

Instantly share code, notes, and snippets.

@toddlers
Created July 24, 2013 14:23
Show Gist options
  • Save toddlers/6071035 to your computer and use it in GitHub Desktop.
Save toddlers/6071035 to your computer and use it in GitHub Desktop.
creating if else structure in puppet templates for more info https://ask.puppetlabs.com/question/288/what-can-i-do-with-erb-templates-in-puppet/
<% if @colo == "a" then -%>
server server1 foo1.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
server server2 foo2.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
server server3 foo3.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
<% elsif @colo == "b" then -%>
server server1 foo1.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
server server2 foo2.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
server server3 foo3.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
<% elsif @colo == "c" then -%>
server server1 foo1.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
server server2 foo2.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
server server3 foo3.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
<% elsif @colo == "d" then -%>
server server1 foo1.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
server server2 foo2.com:8088 check port 8088 inter 5000 rise 2 fall 3 maxconn 5000
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment