Skip to content

Commit 168c318

Browse files
author
Bryan Kendall
committed
adding vault
1 parent 661f733 commit 168c318

4 files changed

Lines changed: 48 additions & 0 deletions

File tree

ansible/group_vars/alpha-vault.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: vault
2+
3+
container_image: runnable/vault
4+
container_tag: v0.3.1
5+
6+
container_run_opts: >
7+
-d
8+
-h {{ inventory_hostname }}
9+
-v /opt/runnable/vault/vault.hcl:/vault.hcl:ro
10+
-p {{ ansible_default_ipv4.address }}:8200:8200
11+
--cap-add IPC_LOCK
12+
--restart=always
13+
14+
container_run_args: >
15+
server
16+
-log-level=warn
17+
-config=/vault.hcl

ansible/roles/vault/tasks/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- name: make vault folder
2+
sudo: yes
3+
file:
4+
state=directory
5+
name=/opt/runnable/vault
6+
7+
- name: copy vault config
8+
sudo: yes
9+
template:
10+
src=vault.hcl
11+
dest=/opt/runnable/vault/vault.hcl
12+
register: copied_config
13+
tags: genDockerConfig
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
backend "consul" {
2+
address = "{{ ansible_default_ipv4.address }}:8500"
3+
path = "vault"
4+
advertise_addr = "http://{{ ansible_default_ipv4.address }}:8200"
5+
}
6+
7+
listener "tcp" {
8+
address = "0.0.0.0:8200"
9+
tls_disable = 1
10+
}

ansible/vault.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- hosts: vault
3+
vars_files:
4+
- group_vars/alpha-vault.yml
5+
roles:
6+
- { role: notify, tags: notify }
7+
- { role: vault }
8+
- { role: container_start, tags: deploy }

0 commit comments

Comments
 (0)