-
Notifications
You must be signed in to change notification settings - Fork 59
/
install.sls
66 lines (56 loc) · 1.95 KB
/
install.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# -*- coding: utf-8 -*-
# vim: ft=sls syntax=yaml softtabstop=2 tabstop=2 shiftwidth=2 expandtab autoindent
{% from "vault/map.jinja" import vault with context %}
vault-package-install-group-present:
group.present:
- name: vault
- system: True
vault-package-install-user-present:
user.present:
- name: vault
- system: True
- gid: vault
- home: /var/lib/vault
- require:
- group: vault-package-install-group-present
vault-package-install-file-directory:
file.directory:
- name: /opt/vault/bin
- makedirs: True
vault-package-install-file-managed:
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-install-service-dead:
service.dead:
- name: vault
- onchanges:
- file: vault-package-install-file-managed
- onlyif: test -f /etc/systemd/system/vault.service
vault-package-install-archive-extracted:
archive.extracted:
- name: /opt/vault/bin
- source: https://releases.hashicorp.com/vault/{{ vault.version }}/vault_{{ vault.version }}_{{ vault.platform }}.zip
- source_hash: https://releases.hashicorp.com/vault/{{ vault.version }}/vault_{{ vault.version }}_SHA256SUMS
- source_hash_name: vault_{{ vault.version }}_{{ vault.platform }}.zip
- enforce_toplevel: False
- overwrite: True
- onchanges:
- file: vault-package-install-file-managed
vault-package-install-file-symlink:
file.symlink:
- name: /usr/local/bin/vault
- target: /opt/vault/bin/vault
- force: true
vault-package-install-pkg-installed:
pkg.installed:
- name: {{ vault.setcap_pkg }}
vault-package-install-cmd-run:
cmd.run:
- name: setcap cap_ipc_lock=+ep /opt/vault/bin/vault
- require:
- pkg: vault-package-install-pkg-installed
- onchanges:
- archive: vault-package-install-archive-extracted