Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vault #36

Merged
merged 5 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions ansible/group_vars/all/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ hashicorp:
daemons:
- consul
- nomad
- vault
tools:
terraform: 0.12.26
consul-template: 0.25.0
Expand Down
23 changes: 23 additions & 0 deletions ansible/templates/vault.hcl.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% raw -%}

ui = true
disable_mlock = true

# (eth1 - default network)

# (docker0)
listener "tcp" {
address = "172.17.0.1:8200"
tls_disable = 1
}
# (eth0)
listener "tcp" {
address = "10.0.2.15:8200"
tls_disable = 1
}
# (eth1)
listener "tcp" {
address = "10.0.3.10:8200"
tls_disable = 1
}
{%- endraw %}
15 changes: 15 additions & 0 deletions ansible/templates/vault.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=vault agent
Requisite=consul.service
After=consul.service

[Service]
Restart=on-failure
ExecStartPre=/bin/sleep 25
ExecStart=/usr/local/bin/vault server -dev -dev-root-token-id=root -config=/etc/vault.d/config.hcl
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
LimitMEMLOCK=infinity

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions test/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Vagrant.configure("2") do |config|
config.vm.network "forwarded_port", guest: 8500, host: 8500, host_ip: "127.0.0.1"
# Hashicorp nomad ui
config.vm.network "forwarded_port", guest: 4646, host: 4646, host_ip: "127.0.0.1"
# Hashicorp vault ui
config.vm.network "forwarded_port", guest: 8200, host: 8200, host_ip: "127.0.0.1"

config.vm.provider "virtualbox" do |vb|
vb.memory = 2048
Expand Down
8 changes: 8 additions & 0 deletions test/ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
until: result.status == 200
retries: 60
delay: 3
- name: Wait for vault to be available
uri:
url: http://127.0.0.1:8200/ui/
status_code: 200
register: result
until: result.status == 200
retries: 60
delay: 3

- name: Terraform
terraform:
Expand Down