formula-vault/vault/server.sls

44 lines
1.1 KiB
Text
Raw Normal View History

2017-04-11 10:55:31 -04:00
{% from "vault/map.jinja" import vault with context %}
{% if vault.self_signed_cert.enabled %}
2017-04-11 09:58:37 -04:00
/usr/local/bin/self-cert-gen.sh:
file.managed:
2017-04-11 10:55:31 -04:00
- source: salt://vault/files/cert-gen.sh.jinja
2017-04-11 09:58:37 -04:00
- template: jinja
- user: root
- group: root
- mode: 644
2017-04-11 10:55:31 -04:00
generate self signed SSL certs:
2017-04-11 09:58:37 -04:00
cmd.run:
2017-04-11 10:55:31 -04:00
- name: bash /usr/local/bin/cert-gen.sh {{ vault.self_signed_cert.hostname }} {{ vault.self_signed_cert.password }}
2017-04-11 09:58:37 -04:00
- cwd: /etc/vault
- require:
- file: /usr/local/bin/self-cert-gen.sh
2017-04-11 10:55:31 -04:00
{% endif %}
2017-04-11 09:58:37 -04:00
/etc/vault/config/server.hcl:
file.managed:
2017-04-11 10:55:31 -04:00
- source: salt://vault/files/server.hcl.jinja
2017-04-11 09:58:37 -04:00
- template: jinja
- user: root
- group: root
- mode: 644
/etc/init/vault.conf:
file.managed:
2017-04-11 10:55:31 -04:00
- source: salt://vault/files/vault.conf.jinja
2017-04-11 09:58:37 -04:00
- template: jinja
- user: root
- group: root
- mode: 644
vault:
service.running:
- enable: True
- require:
2017-04-11 10:55:31 -04:00
{% if vault.self_signed_cert.enabled %}
- cmd: generate self signed SSL certs
{% endif %}
2017-04-11 09:58:37 -04:00
- file: /etc/vault/config/server.hcl
- file: /etc/init/vault.conf