Skip to content

Commit

Permalink
fix(package): fix more review comments
Browse files Browse the repository at this point in the history
* remove "backend file" from defaults as it was always added due to
being a default
  • Loading branch information
rbjorklin committed Mar 30, 2019
1 parent a640f01 commit 65482c2
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 40 deletions.
2 changes: 1 addition & 1 deletion vault/config/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ vault-config-config-file-serialize:
- mode: 640
- makedirs: True
- watch_in:
- vault-service-init-service-running
- service: vault-service-init-service-running
3 changes: 0 additions & 3 deletions vault/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ vault:
self_signed_cert:
enabled: False
config:
storage:
file:
path: /var/lib/vault/data
listener:
tcp:
address: "0.0.0.0:8200"
Expand Down
6 changes: 3 additions & 3 deletions vault/map.jinja
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
# vim: ft=sls syntax=yaml softtabstop=2 tabstop=2 shiftwidth=2 expandtab autoindent

{% import_yaml "vault/defaults.yaml" as defaults %}
{% import_yaml "vault/osfamilymap.yaml" as osfamilymap %}
{% import_yaml "vault/initfamilymap.yaml" as initfamilymap %}
{% import_yaml "vault/defaults.yaml" or {} as defaults %}
{% import_yaml "vault/osfamilymap.yaml" or {} as osfamilymap %}
{% import_yaml "vault/initfamilymap.yaml" or {} as initfamilymap %}

{%- set merged_defaults = salt['grains.filter_by'](defaults,
default='vault',
Expand Down
7 changes: 3 additions & 4 deletions vault/package/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

{% from "vault/map.jinja" import vault with context %}

include:
- .gpg.clean

vault-package-clean-file-absent:
file.absent:
- name: /opt/vault
Expand All @@ -11,10 +14,6 @@ vault-package-clean-file-absent-data:
file.absent:
- name: /var/lib/vault

vault-package-clean-cmd-run:
cmd.run:
- name: gpg --batch --yes --delete-key {{ vault.hashicorp_key_id }}

vault-package-clean-user-absent:
user.absent:
- name: vault
Expand Down
20 changes: 0 additions & 20 deletions vault/package/gpg.sls

This file was deleted.

26 changes: 21 additions & 5 deletions vault/package/signature.sls → vault/package/gpg/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,39 @@

{% from "vault/map.jinja" import vault with context %}

vault-package-signature-file-managed-checksum:
vault-package-gpg-file-managed:
file.managed:
- name: /opt/vault/hashicorp.asc
- contents: |
{{ vault.hashicorp_gpg_key | indent(8) }}
- makedirs: True

vault-package-gpg-pkg-installed:
pkg.installed:
- name: {{ vault.gpg_pkg }}

vault-package-gpg-cmd-run-import:
cmd.run:
- name: gpg --import /opt/vault/hashicorp.asc
- unless: gpg --list-keys {{ vault.hashicorp_key_id }}

vault-package-gpg-file-managed-checksum:
file.managed:
- name: /opt/vault/{{ vault.version }}_SHA256SUMS
- source: https://releases.hashicorp.com/vault/{{ vault.version }}/vault_{{ vault.version }}_SHA256SUMS
- skip_verify: True
- makedirs: True

vault-package-signature-file-managed-signature:
vault-package-gpg-file-managed-signature:
file.managed:
- name: /opt/vault/{{ vault.version }}_SHA256SUMS.sig
- source: https://releases.hashicorp.com/vault/{{ vault.version }}/vault_{{ vault.version }}_SHA256SUMS.sig
- skip_verify: True
- makedirs: True

vault-package-signature-cmd-run:
vault-package-gpg-cmd-run-verify:
cmd.run:
- name: gpg --verify /opt/vault/{{ vault.version }}_SHA256SUMS.sig /opt/vault/{{ vault.version }}_SHA256SUMS
- onchanges:
- vault-package-signature-file-managed-checksum
- vault-package-signature-file-managed-signature
- file: vault-package-gpg-file-managed-checksum
- file: vault-package-gpg-file-managed-signature
1 change: 0 additions & 1 deletion vault/package/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ include:
- .install
{%- if vault.verify_download %}
- .gpg
- .signature
{%- endif %}
2 changes: 1 addition & 1 deletion vault/package/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ vault-package-install-cmd-run:
cmd.run:
- name: setcap cap_ipc_lock=+ep /opt/vault/bin/vault
- onchanges:
- vault-package-install-archive-extracted
- archive: vault-package-install-archive-extracted
4 changes: 2 additions & 2 deletions vault/service/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ vault-service-init-service-running:
- name: vault
- enable: true
- watch:
- vault-package-install-archive-extracted
- vault-service-init-file-managed
- archive: vault-package-install-archive-extracted
- file: vault-service-init-file-managed

0 comments on commit 65482c2

Please sign in to comment.