Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

Commit 9df1d46

Browse files
committed
switching to rhel
1 parent 132d0ec commit 9df1d46

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

ansible/provision.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,35 @@
5454
cidr_ip: 0.0.0.0/0
5555
register: sg
5656

57-
- name: Lookup Fedora Cloud Base AMIs (x86_64, HVM, EBS) from Fedora Project
57+
# Replace the Fedora lookup with a RHEL 10 Marketplace lookup
58+
- name: Lookup latest RHEL 10 HVM SSD AMI (x86_64) from Red Hat / AWS Marketplace
5859
amazon.aws.ec2_ami_info:
5960
region: "{{ aws_region }}"
6061
owners:
61-
- "125523088429" # Fedora Project
62+
- "309956199498" # Red Hat, Inc.
63+
- "aws-marketplace" # Include Marketplace-owned images (requires subscription)
6264
filters:
63-
name: "Fedora-Cloud-Base-*-x86_64-*"
65+
name: "RHEL-10*HVM*x86_64*"
6466
architecture: "x86_64"
6567
virtualization-type: "hvm"
6668
root-device-type: "ebs"
69+
block-device-mapping.volume-type:
70+
- "gp3"
71+
- "gp2"
6772
state: "available"
68-
register: fedora_ami_info
73+
register: rhel_ami_info
6974

70-
- name: Fail if no Fedora AMI found
75+
- name: Fail if no RHEL 10 AMI found
7176
ansible.builtin.fail:
72-
msg: "No Fedora Cloud Base AMI found in {{ aws_region }}. Try a different region or adjust filters."
73-
when: fedora_ami_info.images | length == 0
77+
msg: >-
78+
No RHEL 10 (HVM, SSD) AMI found in {{ aws_region }}.
79+
If you are not subscribed, go to AWS Marketplace and subscribe to
80+
"Red Hat Enterprise Linux 10 (HVM), SSD Volume Type", then retry.
81+
when: rhel_ami_info.images | length == 0
7482

75-
- name: Pick most recent Fedora AMI by creation date
83+
- name: Pick most recent RHEL 10 AMI by creation date
7684
ansible.builtin.set_fact:
77-
fedora_ami: "{{ (fedora_ami_info.images | sort(attribute='creation_date')) | last }}"
85+
rhel_ami: "{{ (rhel_ami_info.images | sort(attribute='creation_date')) | last }}"
7886

7987
- name: Check for existing instance by Name tag
8088
amazon.aws.ec2_instance_info:
@@ -93,7 +101,7 @@
93101
name: "{{ instance_name }}"
94102
region: "{{ aws_region }}"
95103
instance_type: "{{ instance_type }}"
96-
image_id: "{{ fedora_ami.image_id }}"
104+
image_id: "{{ rhel_ami.image_id }}"
97105
security_group: "{{ sg.group_id | default(sg.results[0].group_id) }}"
98106
subnet_id: "{{ subnets.subnets[0].id }}"
99107
wait: true

0 commit comments

Comments
 (0)