Skip to content

Commit

Permalink
Merge pull request #124 from rosalindfranklininstitute/rocky-linux-aws
Browse files Browse the repository at this point in the history
Rocky8 Linux AWS Compute Nodes
  • Loading branch information
milliams authored Aug 31, 2022
2 parents ab0ef9c + dd4e04e commit 876f1e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions roles/packer/files/all.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion roles/packer/templates/prepare_ansible.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions roles/packer/templates/variables.pkrvars.hcl.j2
Original file line number Diff line number Diff line change
@@ -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 -%}"
Expand Down

0 comments on commit 876f1e2

Please sign in to comment.