Hi all.
i have a design question and would appreciate your suggestions.
i would like to use templates to define files on nodes according to the node's environment, for example dev,qa
problem is i have many variables in many groups and defining them all in one file would be pretty ugly
i would like to split each group definitions to a separate file and load it only if i am running in that environment - like source command in shell
using parameterized classes would still require me to send all different values and would not be very readable
end result should be:
1. a variable named port (for example) with the value of 80 in one environment and 8080 in the other
2. values for variables of each environment in a different file for easy management.
my template looks something like this:
env.erb:
export port=<%=port%>
--snip--
and a class with the variables i want to define but instead of literally writing all variables do something like import
case $env {
/dev(.*)/: {
$port=80
}
/qa(.*)/: {
$port=8080
}
}
suggestions?
thanks!