Skip to content

Commit eda2f55

Browse files
authored
Merge pull request #32 from bhumi46/testgrid
[MOSIP-42509] Updated postgresql-setup.sh
2 parents 0b376e5 + 9faae20 commit eda2f55

39 files changed

Lines changed: 542 additions & 567 deletions

File tree

terraform/base-infra/aws/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ resource "aws_subnet" "private" {
5555
Type = "Private"
5656
Environment = var.environment
5757
Project = var.project_name
58-
AZ = var.availability_zones[count.index % length(var.availability_zones)]
58+
AZ = var.availability_zones[count.index % length(var.availability_zones)]
5959
}
6060
}
6161

@@ -229,7 +229,7 @@ resource "aws_instance" "jumpserver" {
229229
Environment = var.environment
230230
Project = var.project_name
231231
}
232-
232+
233233
depends_on = [aws_internet_gateway.main]
234234
}
235235

@@ -238,7 +238,7 @@ resource "aws_eip" "jumpserver" {
238238
count = var.create_jumpserver_eip ? 1 : 0
239239
domain = "vpc"
240240
instance = aws_instance.jumpserver.id
241-
241+
242242
tags = {
243243
Name = "${var.jumpserver_name}-eip"
244244
Environment = var.environment

terraform/base-infra/aws/outputs.tf

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,43 +35,43 @@ output "jumpserver_security_group_id" {
3535
output "cloud_specific" {
3636
description = "AWS-specific outputs"
3737
value = {
38-
vpc_id = aws_vpc.main.id
39-
vpc_cidr = aws_vpc.main.cidr_block
40-
internet_gateway_id = aws_internet_gateway.main.id
41-
nat_gateway_ids = var.enable_nat_gateway ? aws_nat_gateway.main[*].id : []
42-
public_route_table_id = aws_route_table.public.id
38+
vpc_id = aws_vpc.main.id
39+
vpc_cidr = aws_vpc.main.cidr_block
40+
internet_gateway_id = aws_internet_gateway.main.id
41+
nat_gateway_ids = var.enable_nat_gateway ? aws_nat_gateway.main[*].id : []
42+
public_route_table_id = aws_route_table.public.id
4343
private_route_table_ids = var.enable_nat_gateway ? aws_route_table.private[*].id : []
44-
jumpserver_id = aws_instance.jumpserver.id
45-
jumpserver_public_ip = var.create_jumpserver_eip ? aws_eip.jumpserver[0].public_ip : aws_instance.jumpserver.public_ip
46-
jumpserver_private_ip = aws_instance.jumpserver.private_ip
44+
jumpserver_id = aws_instance.jumpserver.id
45+
jumpserver_public_ip = var.create_jumpserver_eip ? aws_eip.jumpserver[0].public_ip : aws_instance.jumpserver.public_ip
46+
jumpserver_private_ip = aws_instance.jumpserver.private_ip
4747
}
4848
}
4949

5050
output "wireguard_info" {
5151
description = "WireGuard configuration information"
5252
value = var.enable_wireguard_setup ? {
53-
enabled = true
54-
peers = var.wireguard_peers
55-
port = 51820
56-
jumpserver_ip = var.create_jumpserver_eip ? aws_eip.jumpserver[0].public_ip : aws_instance.jumpserver.public_ip
53+
enabled = true
54+
peers = var.wireguard_peers
55+
port = 51820
56+
jumpserver_ip = var.create_jumpserver_eip ? aws_eip.jumpserver[0].public_ip : aws_instance.jumpserver.public_ip
5757
config_location = "/home/ubuntu/wireguard/config"
58-
setup_log = "/var/log/jumpserver-setup.log"
59-
status_file = "/home/ubuntu/jumpserver-setup-complete.txt"
60-
message = "WireGuard setup is enabled and configured"
58+
setup_log = "/var/log/jumpserver-setup.log"
59+
status_file = "/home/ubuntu/jumpserver-setup-complete.txt"
60+
message = "WireGuard setup is enabled and configured"
6161
helpful_commands = [
6262
"ssh ubuntu@${var.create_jumpserver_eip ? aws_eip.jumpserver[0].public_ip : aws_instance.jumpserver.public_ip} 'sudo docker logs wireguard'",
6363
"ssh ubuntu@${var.create_jumpserver_eip ? aws_eip.jumpserver[0].public_ip : aws_instance.jumpserver.public_ip} './get-wireguard-configs.sh'",
6464
"ssh ubuntu@${var.create_jumpserver_eip ? aws_eip.jumpserver[0].public_ip : aws_instance.jumpserver.public_ip} 'ls /home/ubuntu/wireguard/config/'"
6565
]
66-
} : {
67-
enabled = false
68-
peers = 0
69-
port = 0
70-
jumpserver_ip = ""
71-
config_location = ""
72-
setup_log = ""
73-
status_file = ""
74-
message = "WireGuard setup is disabled"
66+
} : {
67+
enabled = false
68+
peers = 0
69+
port = 0
70+
jumpserver_ip = ""
71+
config_location = ""
72+
setup_log = ""
73+
status_file = ""
74+
message = "WireGuard setup is disabled"
7575
helpful_commands = []
7676
}
7777
}

terraform/base-infra/azure/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Placeholder resource to prevent module errors
66
resource "null_resource" "azure_placeholder" {
77
count = 1
8-
8+
99
provisioner "local-exec" {
1010
command = "echo 'Azure base infrastructure module - placeholder implementation'"
1111
}

terraform/base-infra/gcp/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Placeholder resource to prevent module errors
66
resource "null_resource" "gcp_placeholder" {
77
count = 1
8-
8+
99
provisioner "local-exec" {
1010
command = "echo 'GCP base infrastructure module - placeholder implementation'"
1111
}

terraform/base-infra/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ module "aws_network" {
2121
availability_zones = local.availability_zones
2222
environment = var.environment
2323
project_name = var.project_name
24-
24+
2525
# MOSIP-specific variables
26-
jumpserver_name = var.jumpserver_name
27-
mosip_email_id = var.mosip_email_id
26+
jumpserver_name = var.jumpserver_name
27+
mosip_email_id = var.mosip_email_id
2828

2929
# Jump server variables
3030
ssh_key_name = var.ssh_key_name

terraform/base-infra/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ variable "cloud_provider" {
33
description = "Cloud provider to deploy infrastructure (aws, azure, gcp)"
44
type = string
55
default = "aws"
6-
6+
77
validation {
88
condition = contains(["aws", "azure", "gcp"], var.cloud_provider)
99
error_message = "Valid values for cloud_provider are: aws, azure, gcp"
@@ -170,7 +170,7 @@ variable "region" {
170170
variable "jumpserver_ami_id" {
171171
description = "The AMI ID to use for the jump server (required)"
172172
type = string
173-
173+
174174
validation {
175175
condition = length(var.jumpserver_ami_id) > 0
176176
error_message = "The jumpserver_ami_id value is required and cannot be empty."

terraform/implementations/aws/observ-infra/aws.tfvars

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ nginx_instance_type = "t3a.large"
3737
# Optional: Exclude specific AZs due to known capacity issues
3838
# Leave empty for fully dynamic behavior (recommended)
3939
# Add AZs only if you experience repeated capacity issues
40-
k8s_capacity_excluded_azs = [] # e.g., ["ap-south-1a"] if needed
41-
nginx_capacity_excluded_azs = [] # e.g., ["ap-south-1a"] if needed
40+
k8s_capacity_excluded_azs = [] # e.g., ["ap-south-1a"] if needed
41+
nginx_capacity_excluded_azs = [] # e.g., ["ap-south-1a"] if needed
4242

4343
# AMI ID (Ubuntu 24.04 LTS in ap-south-1)
4444
ami = "ami-0ad21ae1d0696ad58"
@@ -50,11 +50,11 @@ zone_id = "Z090954828SJIEL6P5406"
5050
vpc_name = "mosip-boxes"
5151

5252
# Minimal storage configuration
53-
nginx_node_root_volume_size = 20 # Smaller than infra (24)
54-
nginx_node_ebs_volume_size = 100 # Smaller than infra (300)
53+
nginx_node_root_volume_size = 20 # Smaller than infra (24)
54+
nginx_node_ebs_volume_size = 100 # Smaller than infra (300)
5555
# Second EBS volume for PostgreSQL (disabled for observ-infra)
56-
nginx_node_ebs_volume_size_2 = 0 # Disabled for observability infrastructure
57-
k8s_instance_root_volume_size = 32 # Smaller than infra (64)
56+
nginx_node_ebs_volume_size_2 = 0 # Disabled for observability infrastructure
57+
k8s_instance_root_volume_size = 32 # Smaller than infra (64)
5858

5959
# Subdomains for observability services
6060
subdomain_public = []
@@ -83,15 +83,15 @@ enable_rancher_import = false
8383
rancher_import_url = "\"kubectl apply -f https://rancher.mosip.net/v3/import/dzshvnb6br7qtf267zsrr9xsw6tnb2vt4x68g79r2wzsnfgvkjq2jk_c-m-b5249w76.yaml\""
8484

8585
# Security group CIDRs
86-
network_cidr = "10.0.0.0/16" # Use your actual VPC CIDR
87-
WIREGUARD_CIDR = "10.0.0.0/24" # Use your actual WireGuard VPN CIDR
86+
network_cidr = "10.0.0.0/16" # Use your actual VPC CIDR
87+
WIREGUARD_CIDR = "10.0.0.0/24" # Use your actual WireGuard VPN CIDR
8888

8989
# PostgreSQL Configuration (used when second EBS volume is enabled)
9090
postgresql_version = "15"
91-
storage_device = "/dev/nvme2n1"
92-
mount_point = "/srv/postgres"
93-
postgresql_port = "5433"
91+
storage_device = "/dev/nvme2n1"
92+
mount_point = "/srv/postgres"
93+
postgresql_port = "5433"
9494

9595
# MOSIP Infrastructure Repository Configuration
9696
mosip_infra_repo_url = "https://github.com/bhumi46/mosip-infra.git"
97-
mosip_infra_branch = "main"
97+
mosip_infra_branch = "main"

terraform/implementations/aws/observ-infra/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ module "mosip_observ_infra" {
4949
nginx_node_ebs_volume_size_2 = var.nginx_node_ebs_volume_size_2
5050
k8s_instance_root_volume_size = var.k8s_instance_root_volume_size
5151

52-
network_cidr = var.network_cidr
53-
WIREGUARD_CIDR = var.WIREGUARD_CIDR
52+
network_cidr = var.network_cidr
53+
WIREGUARD_CIDR = var.WIREGUARD_CIDR
5454

5555
# Rancher and Keycloak Configuration (passed through to module)
5656
enable_rancher_keycloak_integration = var.enable_rancher_keycloak_integration

terraform/implementations/azure/base-infra/azure.tfvars

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ private_subnets = ["10.1.10.0/24", "10.1.11.0/24"]
3939
availability_zones = ["1", "2"]
4040

4141
# Environment metadata
42-
environment = "dev"
42+
environment = "dev"
4343
project_name = "mosip"
4444

4545
# Azure-specific options
46-
enable_nat_gateway = false
47-
single_nat_gateway = true
46+
enable_nat_gateway = false
47+
single_nat_gateway = true
4848
enable_dns_hostnames = true
49-
enable_dns_support = true
49+
enable_dns_support = true

terraform/implementations/azure/base-infra/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,20 @@ module "base_infrastructure" {
123123

124124
# Resource naming
125125
jumpserver_name = var.jumpserver_name
126-
126+
127127
# Network configuration
128128
network_name = var.network_name
129129
network_cidr = var.network_cidr
130130
public_subnets = var.public_subnets
131131
private_subnets = var.private_subnets
132132
availability_zones = var.availability_zones
133-
133+
134134
# Jump server configuration
135135
ssh_key_name = var.ssh_key_name
136136
jumpserver_instance_type = var.jumpserver_instance_type
137137
jumpserver_ami_id = var.jumpserver_ami_id
138138
create_jumpserver_eip = var.create_jumpserver_eip
139-
139+
140140
# Environment metadata
141141
environment = var.environment
142142
project_name = var.project_name

0 commit comments

Comments
 (0)