rice/docker-host/roles/setup/tasks/vault.yml

48 lines
1.1 KiB
YAML
Raw Normal View History

2022-06-25 04:46:41 +00:00
---
- hosts: leftcoastlab
tasks:
- name: Pull In Vars
include_vars:
dir: ../vars
- name: Create Vault Bind Root
2022-09-10 22:10:06 +00:00
become: yes
2022-06-25 04:46:41 +00:00
file:
path: /opt/vault
state: directory
- name: Ensure Vault Bind directories in place
2022-09-10 22:10:06 +00:00
become: yes
2022-06-25 04:46:41 +00:00
file:
path: "/opt/vault/{{item}}"
state: directory
loop:
- config
- logs
- file
- name: Create Vault Config
2022-09-10 22:10:06 +00:00
become: yes
2022-06-25 04:46:41 +00:00
template:
src: ../templates/vault-config.json.j2
dest: /opt/vault/config/vault.json
- name: Start up Vault Service
community.docker.docker_container:
name: vault
image: vault
ports:
- "{{VAULT_PORT}}:8200"
restart_policy: always
volumes:
- /opt/vault/logs:/vault/logs
- /opt/vault/file:/vault/file
- /opt/vault/config:/vault/config
2022-09-10 22:10:06 +00:00
env:
VAULT_ADDR: http://127.0.0.1:8200
2022-06-25 04:46:41 +00:00
capabilities:
- IPC_LOCK
entrypoint:
- vault server -config=/vault/config/vault.json