Checking in to change environments.

zfs
shnee 4 years ago
parent 97f358332c
commit 33f267b163

@ -84,13 +84,15 @@ for GROUP in $ANS_GROUPS; do
# HOSTNAME1=0.0.0.0
# HOSTNAME2=0.0.0.0
VARS="$(
echo $DATA | \
echo -n $DATA | \
jq '.[] | select(.group=="'"$GROUP"'") | .vms[] |
"\(.hostname)=\(.ip)"' | \
sed 's/"//g' | \
sed "s/$VM_NAME_PREFIX-//g" | \
sed 's/-/_/g'
)"
# Print the contents of $VARS converted to uppercase.
# Print the contents of $VARS converted to uppercase. If it's not expty.
if [ ! -z $VARS ]; then
echo "${VARS^^}"
fi
done

@ -4,18 +4,21 @@ locals {
module.aws-network-existing.subnet-by-name["subnet_1"].id,
module.aws-network-existing.subnet-by-name["subnet_3"].id,
]
nfs-subnets = [
module.aws-network-existing.subnet-by-name["subnet_4"],
]
nodes-config = {
"k8s-master" = {
base-image = var.ubuntu-ami
aws-ec2-type = var.t2-medium-4gib-2vcpu
subnet-ids = local.k8s-subnets-ids
num = 1
num = 0
},
"k8s-worker" = {
base-image = var.ubuntu-ami
aws-ec2-type = var.t2-medium-4gib-2vcpu
subnet-ids = local.k8s-subnets-ids
num = 2
num = 0
},
"ansible-test" = {
base-image = var.ubuntu-ami
@ -97,8 +100,21 @@ resource "aws_key_pair" "key" {
}
}
# resource "aws_ebs_volume" "zfs" {
# availability_zone =
resource "aws_ebs_volume" "zfs" {
# TODO REM look at types.
availability_zone = local.nfs-subnets[0].availability_zone
size = 10
encrypted = false
tags = {
Name = "zfs-disk"
}
}
resource "aws_volume_attachment" "mount-nfs-volume" {
device_name = "/dev/sdf"
instance_id = module.nodes["nfs"].nodes[0].id
volume_id = aws_ebs_volume.zfs.id
}
module "nodes" {
for_each = local.nodes-config

@ -9,3 +9,7 @@ output "private_ips" {
output "names" {
value = aws_instance.nodes.*.tags.Name
}
output "nodes" {
value = aws_instance.nodes
}

Loading…
Cancel
Save