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 4 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
18 changes: 18 additions & 0 deletions ansible/templates/vault.hcl.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% raw -%}

ui = true
disable_mlock = true

api_addr = "http://127.0.0.1:8200"
cluster_addr = "http://127.0.0.1:8201"
fredrikhgrelland marked this conversation as resolved.
Show resolved Hide resolved

storage "consul" {
address = "127.0.0.1:8500"
token = "b6e29626-e23d-98b4-e19f-c71a96fbdef7"
}
fredrikhgrelland marked this conversation as resolved.
Show resolved Hide resolved
zhenik marked this conversation as resolved.
Show resolved Hide resolved

listener "tcp" {
address = "127.0.0.1:8200"
tls_disable = 1
}
fredrikhgrelland marked this conversation as resolved.
Show resolved Hide resolved
{%- endraw %}
13 changes: 13 additions & 0 deletions ansible/templates/vault.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=vault agent
Requisite=consul.service
After=consul.service

[Service]
ExecStart=/usr/local/bin/vault server -dev -dev-root-token-id=root
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