Bug fixing slspath-4
This commit is contained in:
parent
dc251d29b1
commit
86d6db1fa4
4 changed files with 23 additions and 22 deletions
|
@ -6,7 +6,8 @@ vault-config:
|
||||||
- source: salt://vault/files/config.hcl
|
- source: salt://vault/files/config.hcl
|
||||||
- template: jinja
|
- template: jinja
|
||||||
- context:
|
- context:
|
||||||
statepath: {{ slspath }}
|
self_signed_cert: {{ vault.self_signed_cert }}
|
||||||
|
config: {{ vault.config }}
|
||||||
- user: {{ vault.user }}
|
- user: {{ vault.user }}
|
||||||
- group: {{ vault.group }}
|
- group: {{ vault.group }}
|
||||||
- mode: 0640
|
- mode: 0640
|
||||||
|
|
|
@ -1,35 +1,35 @@
|
||||||
listener "{{ vault.config.listen_protocol }}" {
|
listener "{{ config.listen_protocol }}" {
|
||||||
address = "{{ vault.config.listen_address }}:{{ vault.config.listen_port }}"
|
address = "{{ config.listen_address }}:{{ config.listen_port }}"
|
||||||
tls_disable = {{ vault.config.tls_disable }}
|
tls_disable = {{ config.tls_disable }}
|
||||||
{%- if vault.self_signed_cert.enabled %}
|
{%- if self_signed_cert.enabled %}
|
||||||
tls_cert_file = "/etc/vault/{{ vault.self_signed_cert.hostname }}.pem"
|
tls_cert_file = "/etc/vault/{{ self_signed_cert.hostname }}.pem"
|
||||||
tls_key_file = "/etc/vault/{{ vault.self_signed_cert.hostname }}-nopass.key"
|
tls_key_file = "/etc/vault/{{ self_signed_cert.hostname }}-nopass.key"
|
||||||
{% else -%}
|
{% else -%}
|
||||||
{%- if vault.config.tls_cert_file %}
|
{%- if config.tls_cert_file %}
|
||||||
tls_cert_file = "{{ vault.config.tls_cert_file }}"
|
tls_cert_file = "{{ config.tls_cert_file }}"
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{%- if vault.config.tls_key_file %}
|
{%- if config.tls_key_file %}
|
||||||
tls_key_file = "{{ vault.config.tls_key_file }}"
|
tls_key_file = "{{ config.tls_key_file }}"
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
{%- if vault.config.backend and vault.config.backend.type == "s3" %}
|
{%- if config.backend and config.backend.type == "s3" %}
|
||||||
backend "s3" {
|
backend "s3" {
|
||||||
bucket = "{{ vault.config.backend.bucket }}"
|
bucket = "{{ config.backend.bucket }}"
|
||||||
}
|
}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
{%- if vault.config.storage and vault.config.storage.type == "consul" %}
|
{%- if config.storage and config.storage.type == "consul" %}
|
||||||
storage "consul" {
|
storage "consul" {
|
||||||
address = "{{ vault.config.storage.address }}"
|
address = "{{ config.storage.address }}"
|
||||||
path = "{{ vault.config.storage.path }}"
|
path = "{{ config.storage.path }}"
|
||||||
}
|
}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
storage "file" {
|
storage "file" {
|
||||||
path = "{{ vault.config.data_dir }}"
|
path = "{{ config.data_dir }}"
|
||||||
}
|
}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
|
|
||||||
default_lease_ttl="{{ vault.config.default_lease_ttl }}"
|
default_lease_ttl="{{ config.default_lease_ttl }}"
|
||||||
max_lease_ttl="{{ vault.config.max_lease_ttl }}"
|
max_lease_ttl="{{ config.max_lease_ttl }}"
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=vault server
|
Description=vault server
|
||||||
Requires=network-online.target
|
Requires=network-online.target
|
||||||
After=network-online.target{% if vault.config.storage and vault.config.storage.type == "consul" %} consul.service{% endif %}
|
After=network-online.target{% if config.storage and config.storage.type == "consul" %} consul.service{% endif %}
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
EnvironmentFile=-/etc/sysconfig/vault
|
EnvironmentFile=-/etc/sysconfig/vault
|
||||||
User={{ user }}
|
User={{ user }}
|
||||||
Group={{ group }}
|
Group={{ group }}
|
||||||
ExecStart=/usr/local/bin/vault server {% if vault.config.dev_mode %}-dev{% else %}-config="/etc/vault.d/config.hcl"{% endif %}
|
ExecStart=/usr/local/bin/vault server {% if config.dev_mode %}-dev{% else %}-config="/etc/vault.d/config.hcl"{% endif %}
|
||||||
ExecReload=/bin/kill -signal HUP $MAINPID
|
ExecReload=/bin/kill -signal HUP $MAINPID
|
||||||
ExecStop=/usr/local/bin/vault operator step-down
|
ExecStop=/usr/local/bin/vault operator step-down
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
|
|
|
@ -42,7 +42,7 @@ vault-init-file:
|
||||||
- context:
|
- context:
|
||||||
user: {{ vault.user }}
|
user: {{ vault.user }}
|
||||||
group: {{ vault.group }}
|
group: {{ vault.group }}
|
||||||
statepath: {{ slspath }}
|
config: {{ vault.config }}
|
||||||
- mode: 0644
|
- mode: 0644
|
||||||
{%- elif salt['test.provider']('service') == 'upstart' %}
|
{%- elif salt['test.provider']('service') == 'upstart' %}
|
||||||
- source: salt://{{ slspath }}/files/vault.upstart
|
- source: salt://{{ slspath }}/files/vault.upstart
|
||||||
|
|
Loading…
Reference in a new issue