Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions t_server/original/run_t_clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ EOF
for T in $TESTSETS
do
echo "$T..."
JOBS=""
declare -A JOBS=()
for G in $TESTGROUPS
do
LOG=$LOGDIR/$DAY/$NOW.$T.$G.out

echo "Starting $T/$G..."
ssh -i "$KEY" "$HOST" "TEST_RUN_OVERRIDE='${TEST_RUN_OVERRIDE:-}' TEST_RUN_GROUP=$G ./bin/t_client.sh $T" >"$LOG" 2>&1 &
JOBS="$JOBS $!"
JOBS[$G]=$!
done
echo "$T..." >> $SUMMARY
G=1
for J in $JOBS
for G in $TESTGROUPS
do
J=${JOBS[$G]}
LOG=$LOGDIR/$DAY/$NOW.$T.$G.out

echo "Waiting for $T/$G (pid=$J)..."
Expand All @@ -65,7 +65,6 @@ do
echo ""
exit 1
esac
G=$((G + 1))
done
done

Expand Down
6 changes: 5 additions & 1 deletion t_server/tofu/openvpn_test_env/input.auto.tfvars.sample
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ external_primary_vpc_id = "vpc-abcdef0123456789a"
external_primary_vpc_primary_public_subnet_id = "subnet-cdef0123456789abc"
external_primary_vpc_primary_public_route_table_id = "rtb-f0123456789abcdef012"

# if you set manage_vpc to true, you can change the name of the VPC
vpc_name = "production"

### VPC settings
#
# Only required when this module manages the VPC
Expand Down Expand Up @@ -79,7 +82,8 @@ private_dns_zone_name = "tserver.vpn"
# t_server VPN CIDR block
tserver_rocky_9_amd64_vpn_cidr_block = "10.52.124.0/24"

# This gets added to AWS tags and is purely informal
# This gets added to AWS name tags to make resources from different deployments
# easier to differentiate
deployment = "production"

# Hostnames for the t_server EC2 instances; these will be added to private DNS
Expand Down
2 changes: 1 addition & 1 deletion t_server/tofu/openvpn_test_env/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module "ami" {
module "primary-vpc" {
count = var.manage_vpc ? 1 : 0
source = "github.com/Puppet-Finland/opentofu-vpc?ref=1.1.0"
basename = "production"
basename = var.vpc_name
region = var.region
Comment thread
flichtenheld marked this conversation as resolved.
manage_ipv4_nat_gateway = false
vpc_cidr_block = var.primary_vpc_cidr_block
Expand Down
8 changes: 4 additions & 4 deletions t_server/tofu/openvpn_test_env/sg.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module "primary-vpc-standard-sg" {
source = "github.com/Puppet-Finland/opentofu-sg-standard?ref=1.1.0"
basename = "production"
basename = var.deployment
vpc_id = local.primary_vpc_id
allow_ssh_cidr_blocks = [local.primary_vpc_cidr_block]
allow_ssh_ipv6_cidr_blocks = ["::1/128", local.primary_vpc_ipv6_cidr_block]
Expand Down Expand Up @@ -31,18 +31,18 @@ resource "aws_security_group_rule" "allow_ssh_from_any_ipv6" {

module "primary-vpc-webserver-public-sg" {
source = "github.com/Puppet-Finland/opentofu-sg-webserver?ref=1.0.0"
basename = "production"
basename = var.deployment
vpc_id = local.primary_vpc_id
type = "public"
}

resource "aws_security_group" "webcache" {
name = "webcache"
name = "${var.deployment}-webcache"
description = "Allow access to TCP on ports 8080-8090"
vpc_id = local.primary_vpc_id

tags = {
Name = "webcache"
Name = "${var.deployment}-webcache"
}
}

Expand Down
3 changes: 2 additions & 1 deletion t_server/tofu/openvpn_test_env/tserver_anchor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ resource "aws_instance" "tserver_anchor" {
key_name = var.key_name
source_dest_check = false
subnet_id = local.primary_vpc_primary_public_subnet_id
tags = { "Name" : "tserver-anchor",
tags = { "Name" : "${var.deployment}-tserver-anchor",
"Role" : "Static tserver OpenVPN client",
"Deployment" : var.deployment,
"tostop" : "true",
"Distro" : "Rocky",
"Login" : "rocky" }
Expand Down
3 changes: 2 additions & 1 deletion t_server/tofu/openvpn_test_env/tserver_client.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ resource "aws_instance" "tserver_client" {
key_name = var.key_name
source_dest_check = false
subnet_id = local.primary_vpc_primary_public_subnet_id
tags = { "Name" : "tserver-client",
tags = { "Name" : "${var.deployment}-tserver-client",
"Role" : "Static tserver OpenVPN client",
"Deployment" : var.deployment,
"tostop" : "true",
"Distro" : "Rocky",
"Login" : "rocky" }
Expand Down
3 changes: 2 additions & 1 deletion t_server/tofu/openvpn_test_env/tserver_rocky_9_amd64.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ resource "aws_instance" "tserver_rocky_9_amd64" {
key_name = var.key_name
source_dest_check = false
subnet_id = local.primary_vpc_primary_public_subnet_id
tags = { "Name" : "tserver-rocky-9-amd64",
tags = { "Name" : "${var.deployment}-tserver-rocky-9-amd64",
"Role" : "tserver",
"Deployment" : var.deployment,
"tostop" : "true",
"Distro" : "Rocky",
"Login" : "rocky" }
Expand Down
4 changes: 2 additions & 2 deletions t_server/tofu/openvpn_test_env/tserver_sg.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
resource "aws_security_group" "tserver" {
name = "tserver"
name = "${var.deployment}-tserver"
description = "Allow access to OpenVPN ports"
vpc_id = local.primary_vpc_id

tags = {
Name = "tserver"
Name = "${var.deployment}-tserver"
}
}

Expand Down
8 changes: 7 additions & 1 deletion t_server/tofu/openvpn_test_env/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ variable "manage_vpc" {
default = true
}

variable "vpc_name" {
description = "How to name the VPC (only if manage_vpc=true)"
type = string
default = "production"
}

# Parameters
variable "public_dns_zone_name" {
description = "Public Route 53 hosted zone name. Required when enable_public_dns_zone is true."
Expand All @@ -35,7 +41,7 @@ variable "private_dns_zone_name" {
}

variable "deployment" {
description = "Informal deployment name added to EC2 instance tags"
description = "Deployment name added to EC2 resource names"
type = string
}

Expand Down