From f12253be27f68da5c3335dde594cefc9822089fd Mon Sep 17 00:00:00 2001 From: lolli001 Date: Wed, 17 Jul 2024 15:56:29 -0400 Subject: [PATCH] Added pkr file and updated main.tf --- main.tf | 1 + modules/image-pipeline/build.pkr.hcl | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 modules/image-pipeline/build.pkr.hcl diff --git a/main.tf b/main.tf index 4278363..2b9abca 100644 --- a/main.tf +++ b/main.tf @@ -146,6 +146,7 @@ module "rhel-arm" { instance_type = "t4g.micro" } + resource random_password winrm { length = 24 override_special = "$*!" diff --git a/modules/image-pipeline/build.pkr.hcl b/modules/image-pipeline/build.pkr.hcl new file mode 100644 index 0000000..c38e35a --- /dev/null +++ b/modules/image-pipeline/build.pkr.hcl @@ -0,0 +1,25 @@ +variable "project_name" { + type = string + default = "rhel-arm-image-pipeline-demo" +} + +variable "ansible_dir" { + type = string + default = "" +} + +source "amazon-ebs" "rhel-arm" { + ami_name = "${var.project_name}-{{timestamp}}" + instance_type = "t4g.micro" + region = "us-gov-west-1" + source_ami = "ami-0ce8fc041db68907c" + ssh_username = "ec2-user" +} + +build { + sources = ["source.amazon-ebs.rhel-arm"] + + provisioner "ansible" { + playbook_file = "${var.ansible_dir}/rhel-arm-baseline.yaml" + } +}