From 40b0776ce973bd6d649e6152bd51b9734a130a01 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Tue, 26 Jul 2022 20:14:48 -0700 Subject: [PATCH] WIP: Enable vault oidc provider --- nomad/acls/acls.tf | 6 ++++ nomad/acls/vars.tf | 5 +++ nomad/acls/vault_login.tf | 16 +++++++++ nomad/acls/vault_oidc_provider.tf | 60 +++++++++++++++++++++++++++++++ 4 files changed, 87 insertions(+) create mode 100644 nomad/acls/vault_oidc_provider.tf diff --git a/nomad/acls/acls.tf b/nomad/acls/acls.tf index 4631b7c..b4071d1 100644 --- a/nomad/acls/acls.tf +++ b/nomad/acls/acls.tf @@ -4,3 +4,9 @@ resource "nomad_acl_policy" "create_post_bootstrap_policy" { description = "Anon RW" rules_hcl = file("${path.module}/nomad-anon-bootstrap.hcl") } + +resource "nomad_acl_policy" "admin" { + name = "admin" + description = "admin policy with access to everything" + rules_hcl = file("${path.module}/nomad-anon-bootstrap.hcl") +} diff --git a/nomad/acls/vars.tf b/nomad/acls/vars.tf index 4c6fcca..d619625 100644 --- a/nomad/acls/vars.tf +++ b/nomad/acls/vars.tf @@ -15,3 +15,8 @@ variable "vault_token" { sensitive = true default = "" } + +variable "vault_admin_password" { + type = string + sensitive = true +} diff --git a/nomad/acls/vault_login.tf b/nomad/acls/vault_login.tf index 149bf4e..d6664b2 100644 --- a/nomad/acls/vault_login.tf +++ b/nomad/acls/vault_login.tf @@ -6,3 +6,19 @@ resource "vault_auth_backend" "userpass" { listing_visibility = "unauth" } } + +resource "vault_generic_secret" "admin_user" { + path = "auth/userpass/users/admin" + + data_json = <