diff --git a/vault/config.sls b/vault/config.sls index b93b78a..899ff60 100644 --- a/vault/config.sls +++ b/vault/config.sls @@ -5,6 +5,8 @@ vault-config: - name: /etc/vault.d/config.hcl - source: salt://vault/files/config.hcl - template: jinja + - context: + statepath: {{ slspath }} - user: {{ vault.user }} - group: {{ vault.group }} - mode: 0640 diff --git a/vault/files/config.hcl b/vault/files/config.hcl index f570fca..b5aa17f 100644 --- a/vault/files/config.hcl +++ b/vault/files/config.hcl @@ -1,4 +1,4 @@ -{%- from slspath + '/map.jinja' import vault with context -%} +{%- from statepath + '/map.jinja' import vault with context -%} listener "{{ vault.config.listen_protocol }}" { address = "{{ vault.config.listen_address }}:{{ vault.config.listen_port }}" diff --git a/vault/files/vault.service b/vault/files/vault.service index 2a6c59c..1e9aa7a 100644 --- a/vault/files/vault.service +++ b/vault/files/vault.service @@ -1,4 +1,4 @@ -{%- from slspath + '/map.jinja' import vault with context -%} +{%- from statepath + '/map.jinja' import vault with context -%} [Unit] Description=vault server Requires=network-online.target diff --git a/vault/service.sls b/vault/service.sls index b8e1568..2b44ee4 100644 --- a/vault/service.sls +++ b/vault/service.sls @@ -42,6 +42,7 @@ vault-init-file: - context: user: {{ vault.user }} group: {{ vault.group }} + statepath: {{ slspath }} - mode: 0644 {%- elif salt['test.provider']('service') == 'upstart' %} - source: salt://{{ slspath }}/files/vault.upstart