Fix up vault ssl, fix up vault cert since it needs a bundled cert

This commit is contained in:
Amarpreet Minhas 2020-10-13 21:42:39 -04:00
parent b5d51f7e3f
commit 1559206ae4
8 changed files with 15 additions and 8 deletions

View file

@ -1,5 +1,6 @@
---
- hosts: vault_server
serial: 1
roles:
- role: vault_server
...

View file

@ -72,7 +72,7 @@
args:
executable: /bin/bash
environment:
VAULT_ADDR: http://ivyking.minhas.io:8200
VAULT_ADDR: http://vault.service.masked.name:8200
VAULT_TOKEN: "{{ lookup('file', lookup('env', 'HOME') + '/.vault-token') }}"
VAULT_FORMAT: json
register: cert_data

View file

@ -82,7 +82,7 @@
args:
executable: /usr/local/bin/bash
environment:
VAULT_ADDR: http://ivyking.minhas.io:8200
VAULT_ADDR: http://vault.service.masked.name:8200
VAULT_TOKEN: "{{ lookup('file', lookup('env', 'HOME') + '/.vault-token') }}"
VAULT_FORMAT: json
register: cert_data

View file

@ -42,7 +42,7 @@
args:
executable: /usr/local/bin/bash
environment:
VAULT_ADDR: http://ivyking.minhas.io:8200
VAULT_ADDR: http://vault.service.masked.name:8200
VAULT_TOKEN: "{{ lookup('file', lookup('env', 'HOME') + '/.vault-token') }}"
VAULT_FORMAT: json
register: cert_data

View file

@ -18,7 +18,7 @@
args:
executable: /bin/bash
environment:
VAULT_ADDR: http://ivyking.minhas.io:8200
VAULT_ADDR: http://vault.service.masked.name:8200
VAULT_TOKEN: "{{ lookup('file', lookup('env', 'HOME') + '/.vault-token') }}"
VAULT_FORMAT: json
register: cert_data

View file

@ -107,7 +107,7 @@
args:
executable: /bin/bash
environment:
VAULT_ADDR: http://ivyking.minhas.io:8200
VAULT_ADDR: http://vault.service.masked.name:8200
VAULT_TOKEN: "{{ lookup('file', lookup('env', 'HOME') + '/.vault-token') }}"
VAULT_FORMAT: json
register: cert_data

View file

@ -87,7 +87,7 @@
args:
executable: /bin/bash
environment:
VAULT_ADDR: http://ivyking.minhas.io:8200
VAULT_ADDR: http://vault.service.masked.name:8200
VAULT_TOKEN: "{{ lookup('file', lookup('env', 'HOME') + '/.vault-token') }}"
VAULT_FORMAT: json
register: cert_data
@ -114,6 +114,12 @@
mode: "0600"
}
- name: append cacert to vault cert
blockinfile:
path: /etc/nomad.d/certs/nomad.pem
block: |
{{ vault_ca_cert_payload }}
- name: ensure nomad is started and enabled
systemd:
name: nomad

View file

@ -12,8 +12,8 @@ listener "tcp" {
tls_key_file = "/etc/vault.d/certs/vault.key"
}
api_address = "{{ ansible_default_ipv4.address }}:8200"
cluster_address = "{{ ansible_default_ipv4.address }}:8201"
api_addr = "https://{{ ansible_default_ipv4.address }}:8200"
cluster_addr = "https://{{ ansible_default_ipv4.address }}:8201"
storage "consul" {
address = "localhost:8500"