From 2f34180da826da8c1a669b9b601192cf45cd439b Mon Sep 17 00:00:00 2001 From: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> Date: Fri, 28 Apr 2023 16:16:25 -0400 Subject: [PATCH] Fix `ansible` package install Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com> --- cloud-init.sh | 5 +++-- ec2.tf | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cloud-init.sh b/cloud-init.sh index c65eb59..c6196c8 100644 --- a/cloud-init.sh +++ b/cloud-init.sh @@ -5,9 +5,10 @@ sudo yum -y update # Register system with Red Hat sudo subscription-manager unregister -sudo subscription-manager register --username ${rh_subscription_username} --password '${rh_subscription_password}' +sudo subscription-manager register --username "${rh_subscription_username}" --password "${rh_subscription_password}" sudo subscription-manager refresh -sudo subscription-manager attach --pool ${rh_subscription_pool_id} +sudo subscription-manager attach --pool "${rh_subscription_pool_id}" +sudo subscription-manager config --rhsm.manage_repos=1 sudo subscription-manager repos --enable="rhel-7-server-rpms" --enable="rhel-7-server-extras-rpms" --enable="rhel-7-server-ansible-2.9-rpms" --enable="rhel-server-rhscl-7-rpms" --enable="rhel-7-server-ose-3.11-rpms" # Signal to Terraform that update is complete and reboot diff --git a/ec2.tf b/ec2.tf index 0d14391..8bf90c3 100644 --- a/ec2.tf +++ b/ec2.tf @@ -16,7 +16,7 @@ data "aws_ami" "rhel" { } filter { name = "name" - values = ["RHEL-7.7*GA*"] + values = ["RHEL-7*"] } } @@ -52,12 +52,12 @@ resource "aws_instance" "bastion" { provisioner "file" { content = data.template_file.inventory.rendered - destination = "~/inventory.yaml" + destination = "./inventory.yaml" } provisioner "file" { content = file(var.ssh_private_key_path) - destination = "~/.ssh/id_rsa" + destination = "./.ssh/id_rsa" } }