markround/tiller

Tiller does not produce when the only data source is Vault

Opened this issue · 2 comments

Hi @markround,

I've noticed that with the configuration below, tiller does not produce parsed templates:

data_sources: [ vault ]
template_sources: [ file ]

environments:
    production:
        postgres_dashboard.erb:
            target: 'parsed_template.txt'

vault:
 url: 'https://<MASTER_URL>'
 token: '<VAULT_TOKEN>'
➜  tiller  tiller -b . -v -n -e production
tiller v0.9.7 (https://github.com/markround/tiller) <github@markround.com>
Using configuration from .
Using plugins from /usr/local/lib/tiller


Using environment production
Template sources loaded [FileTemplateSource]
Data sources loaded [EnvironmentDataSource, VaultDataSource]
Available templates : ["postgres_dashboard.erb"]
Template generation completed

Although when data source is set to data_sources: [ vault, file ], it builds a template and saves to a file:

Building template postgres_dashboard.erb
Not running as root, so not setting ownership/permissions on parsed_template.txt

It fails with vault as an only data source, because target values variable is empty and file generation is skipped.

So if there's either defaults section and defaults data source or file section and file data source, all works fine.

defaults:
  postgres_dashboard.erb:
      target: 'template_temp.txt

Not a huge issue, but perhaps Vault plugin documentation should have a note that common.yaml should have an environment or defaults sources with target section specified?

Thanks for the comments! I think that this section in the README covers it:

File : The default template_ and data_source plugins which read templates from ERB files on disk, and values from YAML file(s). This use-case is discussed below in this main document. Important: You normally will want to enable these plugins unless you are fetching everything from another data source, as Tiller needs this to read configuration blocks from common.yaml, fetch templates from disk etc.

However, I should probably make that bigger and bolder as it seems to be a fairly common problem. Maybe reference it in the Gotchas section as well as referencing it in plugin docs. Actually, I keep meaning to go through and have a major documentation overhaul and tidy-up (the main README has got pretty large and unwieldy), this would be an ideal time to get started on that ;)

Awesome, thanks Mark! 👍