Skip to content

Commit

Permalink
add new instance raid configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyfoil committed Feb 17, 2022
1 parent c13a346 commit 48fbefb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ set +e
touch /home/ubuntu/user-data-started
${var.cloud_provider == "azure" && var.type == "library" ? file("${path.module}/templates/azure_api.tpl") : ""}
${var.cloud_provider == "gcp" && var.type == "library" ? file("${path.module}/templates/gcp_api.tpl") : ""}
${var.driver_type == "raid" && var.cloud_provider == "aws" ? file("${path.module}/templates/instance_raid.tpl") : ""}
${var.driver_type == "nitro" && local.ebs_attachment && var.cloud_provider == "aws" && !var.boot_drive_nvme ? file("${path.module}/templates/nitro_ebs.tpl") : ""}
${var.driver_type == "nitro" && local.ebs_attachment && var.cloud_provider == "aws" && var.boot_drive_nvme ? file("${path.module}/templates/nitro_ebs_boot_nvme.tpl") : ""}
${var.driver_type == "standard" && local.ebs_attachment && var.cloud_provider == "aws" ? file("${path.module}/templates/standard_ebs.tpl") : ""}
Expand All @@ -24,4 +25,3 @@ EOF

vars = {}
}

5 changes: 5 additions & 0 deletions templates/instance_raid.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mdadm --create --verbose /dev/md0 --level=0 --name=data --raid-devices=2 /dev/nvme1n1 /dev/nvme2n1
mkdir -p /data
chown -R ubuntu:ubuntu /data
mkfs -t xfs -L data /dev/md0
mount LABEL=data /data

0 comments on commit 48fbefb

Please sign in to comment.