25 lines
1.1 KiB
YAML
25 lines
1.1 KiB
YAML
#cloud-config
|
|
# The Vault of a test project: HashiCorp's vault package from its apt repository, file storage and a plain HTTP
|
|
# listener; lm_dev.vault_initialise initialises and unseals it over its API.
|
|
write_files:
|
|
- path: /root/vault.hcl
|
|
permissions: '0644'
|
|
content: |
|
|
storage "file" {
|
|
path = "/opt/vault/data"
|
|
}
|
|
listener "tcp" {
|
|
address = "0.0.0.0:8200"
|
|
tls_disable = "true"
|
|
}
|
|
disable_mlock = true
|
|
ui = true
|
|
runcmd:
|
|
- wget -O - https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
|
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" > /etc/apt/sources.list.d/hashicorp.list
|
|
- apt-get update
|
|
- DEBIAN_FRONTEND=noninteractive apt-get install -y vault
|
|
- install -d -o vault -g vault -m 0700 /opt/vault/data
|
|
- install -m 0644 /root/vault.hcl /etc/vault.d/vault.hcl
|
|
- systemctl enable --now vault
|