Templates in Chef works great for generating configuration files - you have templating engine for creating the files, and you can pass parameter at multiple levels - default, role-based, node.
Is there anything like that for the deployment automation platform glu?
The only thing similar I could find, is this example of setting-up jetty. If you look at the end of the script, you'll see some multi-line strings, which are used as file contents for specific files. This could work, but seems somewhat messy, and I was hoping for a better way.
glu does not have any built-in template mechanism.
That being said, like you point out in the example, you can use the shell.saveContent() api which allows you to replace @xxx@ values automatically. The "String" that you replace does not have to be inside the glu script itself and can simply be read from a url by using the shell.cat(url) api.
If you want to be more sophisticated, a glu script is simply written in groovy so you can use the templating mechanism that comes with groovy: http://groovy.codehaus.org/Groovy+Templates
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With