markround/tiller

Same ERB template for all environments

Closed this issue · 4 comments

How would I go about specifying a single erb template for all of my environments? I currently have this in my common.yaml file:


---
exec: [ "/usr/bin/supervisord", "-n" ]
data_sources:
  - file
  - environment
  - defaults
template_sources:
  - file
defaults:
  global:
    some.properties.erb:
      user:   myuser
      group:  mygroup
      perms:  0644
      target: /usr/local/some.properties

When I run the above, I get this:
Error : Could not load environment file /etc/tiller/environments/development.yaml

The error message is correct, but I didn't want to have to specify that the template belongs to development environment when it belongs to all of my environments. I was just looking for a way to specify the template globally so that it's automatically available to all of my environments.

Hi,

Quick question - are you actually using multiple environments (each with a slightly different config/set of templates) and one common global template ? Or do you simply want to produce a parameterized container with a common set of templates wherever it runs ?

I see one small issue with your config by the way - the template should not be under the global: block, inside defaults: that's for defining values across all your templates. You'd want to do something like :

defaults:
  some.properties.erb:
    user:   myuser
    group:  mygroup
    perms:  0644
    target: /usr/local/some.properties

This might help. Although you'll still need to define at least one environment - either in the common.yaml, or in a separate environments/<env_name>.yaml file. Let me know if this fixes your issue, or if you'd like me to change the behaviour of Tiller in some way to help with your use case.

I'm going to be away for a few days with no access to the Internet, but if you need some modifications, I can work on it as soon as I'm back :)

Thanks,

-Mark

@humbargs : Hi, I'm back now. Did the above resolve your issue ?

Closing due to lack of feedback. Please re-open if this is still causing an issue :)