saltstack-formulas / vault-formula

Home Page:http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to define backend

mruepp opened this issue · comments

I tried various backend configurations in pillar:
backend: "inmem"
backend: "file" { path = "/path/to" }
backend: "file" { path : "/path/to" }
backend: { storage = "inmem"}
backend: { storage : "inmem"}

but I can not figure out how to configure the storage backend. I always get either:
File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 436, in render_jinja_tmpl
buf=tmplstr)
SaltRenderError: Jinja variable 'dict object' has no attribute 'type'

if i use backend: " "
or

expected , but found '{'
in "", line 14, column 19:
backend: "file" { path = "/var/vault"}

Updated the server.hcl.jinja. I am unable to create pull request because I am behind corp. firewall...

Here the changes:

{%- if vault.storage -%}
storage "{{ vault.storage.type }}"
{%- if vault.storage.parameter %} {
{%- for key,value in vault.storage.parameter.items() %}
{{ key }} = "{{ value }}"
{%- endfor %}
}
{%- endif -%}
{%- endif %}

In the defaults.yaml just add the storage parameters.

storage:
type: "file"
parameter:
path: "/var/vault"