Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Equivalent of Chef's templates in Glu

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.

like image 774
jmruc Avatar asked Feb 02 '26 07:02

jmruc


1 Answers

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

like image 187
yan Avatar answered Feb 04 '26 01:02

yan