Skip to content

Instantly share code, notes, and snippets.

@devops-adeel
devops-adeel / aad_oidc_grp.tf
Last active October 11, 2023 15:30
Terraform snippet to setup AzureAD Auth Method.
locals {
aad_group = var.aad_group
application = var.application_name
mount_accessor = var.mount_accessor
}
data "azuread_group" "default" {
display_name = local.aad_group
}
# This should be run as root
# this creates a self-signed certificate with the IP addresses as IP SANS
# Todo - see if we want to roll this into https://github.com/hashicorp/linux-packaging/blob/master/products/vault/scripts/postinst
# dump interfaces to file to work with
ifconfig > ifconfig.txt
# Get number of IPs returned, excluding the ip6 loopback for now
grep "inet" ifconfig.txt | grep -v "::1" | awk -F' ' '{print $2}' | wc -l