diff --git a/main.tf b/main.tf index b070f8d..97ab22e 100755 --- a/main.tf +++ b/main.tf @@ -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") : ""} @@ -24,4 +25,3 @@ EOF vars = {} } - diff --git a/templates/instance_raid.tpl b/templates/instance_raid.tpl new file mode 100644 index 0000000..2937709 --- /dev/null +++ b/templates/instance_raid.tpl @@ -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 \ No newline at end of file