box icon indicating copy to clipboard operation
box copied to clipboard

Feature: template keyword

Open erikh opened this issue 8 years ago • 4 comments
trafficstars

This keyword would accept a source filename, target filename, and a map of parameters. The parameters would be included into a go or erb template (torn on this; go would be much simpler and erb would be more familiar to devops-y types) which would then be copied into the container.

example:

template "hosts.tmpl", "/etc/hosts", hosts: ["127.0.0.1 localhost"]

erikh avatar Dec 15 '16 18:12 erikh

torn on this; go would be much simpler and erb would be more familiar to devops-y types

I know what you mean... there is Ego, but it's a kind of weird mix of both worlds. How about something like Mustache as a compromise for the start?

errordeveloper avatar Jan 11 '17 08:01 errordeveloper

well mruby has erb already, it should just need to be activated. this is more of a power/simplicity argument.

erikh avatar Jan 11 '17 16:01 erikh

Why not just use the standard library templates?

Xe avatar Jan 12 '17 01:01 Xe

@Xe right; that was the other option I floated initially. erb templates would be a lot more powerful I think (and more familiar to people coming from a chef/puppet background) but go templates would be a lot simpler and easier to describe in documentation.

Either way if someone beats me to this with a patch they'll probably get what they want. :)

erikh avatar Jan 12 '17 03:01 erikh