Skip to content

Commit

Permalink
Fix ansible package install
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <[email protected]>
  • Loading branch information
dhaiducek committed Apr 28, 2023
1 parent 3afbaa7 commit 2f34180
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cloud-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions ec2.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data "aws_ami" "rhel" {
}
filter {
name = "name"
values = ["RHEL-7.7*GA*"]
values = ["RHEL-7*"]
}
}

Expand Down Expand Up @@ -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"
}
}

Expand Down

0 comments on commit 2f34180

Please sign in to comment.