diff --git a/roles/packer/files/all.pkr.hcl b/roles/packer/files/all.pkr.hcl index f92c810d..3850bd76 100644 --- a/roles/packer/files/all.pkr.hcl +++ b/roles/packer/files/all.pkr.hcl @@ -63,10 +63,10 @@ source "amazon-ebs" "aws" { instance_type = var.aws_instance_type source_ami_filter { filters = { - name = "CentOS 8.*" + name = "Rocky-8*" architecture = var.aws_arch } - owners = ["125523088429"] + owners = ["792107900819"] #Owner ID as stated from https://forums.rockylinux.org/t/rocky-linux-official-aws-ami/3049/25 most_recent = true } ssh_username = var.ssh_username diff --git a/roles/packer/templates/prepare_ansible.sh.j2 b/roles/packer/templates/prepare_ansible.sh.j2 index 0637bb52..f8cbb2e0 100644 --- a/roles/packer/templates/prepare_ansible.sh.j2 +++ b/roles/packer/templates/prepare_ansible.sh.j2 @@ -9,9 +9,13 @@ $(hostname) cluster_id={{ startnode_config.cluster_id }} packer_run=yes EOF' -{% if ansible_local.citc.csp in ["aws", "google"] %} +{% if ansible_local.citc.csp == "google" %} sudo yum install -y epel-release sudo dnf config-manager --set-enabled powertools +{% elif ansible_local.citc.csp == "aws" %} +sudo yum install -y epel-release +sudo dnf config-manager --set-enabled powertools +sudo dnf install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r) {% elif ansible_local.citc.csp == "oracle" %} sudo dnf install -y oracle-epel-release-el8 sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm diff --git a/roles/packer/templates/variables.pkrvars.hcl.j2 b/roles/packer/templates/variables.pkrvars.hcl.j2 index 02d22f0e..a475bfd5 100644 --- a/roles/packer/templates/variables.pkrvars.hcl.j2 +++ b/roles/packer/templates/variables.pkrvars.hcl.j2 @@ -1,11 +1,11 @@ ca_cert = "{{ ca_cert }}" cluster = "{{ startnode_config.cluster_id }}" destination_image_name = "citc-slurm-compute" -ssh_username = "{%- if ansible_local.citc.csp in ["aws", "google"] -%}centos{%- else -%}opc{%- endif -%}" +ssh_username = "{%- if ansible_local.citc.csp in ["google"] -%}centos{%- elif ansible_local.citc.csp in ["aws"] -%}rocky{%- else -%}opc{%- endif -%}" aws_arch = "x86_64" aws_region = "{%- if startnode_config.region is defined -%}{{ startnode_config.region }}{%- endif -%}" -aws_instance_type = "t2.nano" +aws_instance_type = "t2.micro" google_destination_image_family = "citc-slurm-compute" google_network = "{%- if startnode_config.network_name is defined -%}{{ startnode_config.network_name }}{%- endif -%}"