packer: use 8.6 as a base for RHEL images

Let's stay updated!

Also, let's remove 8.4 and 8.5 from Schutzfile, I strongly believe that it's
not used anywhere.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-06-30 13:30:04 +02:00 committed by Sanne Raymaekers
parent e52bd38ccf
commit 767283b2d9
3 changed files with 5 additions and 19 deletions

View file

@ -153,20 +153,6 @@
}
]
},
"rhel-8.4": {
"dependencies": {
"osbuild": {
"commit": "86123da599efa117c0a8c079212becb54b304724"
}
}
},
"rhel-8.5": {
"dependencies": {
"osbuild": {
"commit": "86123da599efa117c0a8c079212becb54b304724"
}
}
},
"rhel-8.6": {
"dependencies": {
"osbuild": {

View file

@ -28,8 +28,8 @@ build {
source "amazon-ebs.image_builder" {
name = "rhel-8-x86_64"
# Use a static RHEL 8.5 Cloud Access Image.
source_ami = "ami-06f1e6f8b3457ae7c"
# Use a static RHEL 8.6 Cloud Access Image.
source_ami = "ami-03debf3ebf61b20cd"
ssh_username = "ec2-user"
instance_type = "c6a.large"

View file

@ -79,7 +79,7 @@ mkdir -p "$RPMBUILD_DIR"
aws ec2 create-key-pair --key-name "$KEY_NAME" --query 'KeyMaterial' --output text > /osbuild-composer/keypair.pem
chmod 600 /osbuild-composer/keypair.pem
# rhel 8.5 AMI
aws ec2 run-instances --image-id ami-06f1e6f8b3457ae7c --instance-type c5.large --key-name "$KEY_NAME" \
aws ec2 run-instances --image-id ami-03debf3ebf61b20cd --instance-type c5.large --key-name "$KEY_NAME" \
--tag-specifications "ResourceType=instance,Tags=[{Key=commit,Value=$COMMIT_SHA},{Key=name,Value=rpm-builder-$COMMIT_SHA}]" \
> ./rpminstance.json
AWS_INSTANCE_ID=$(jq -r '.Instances[].InstanceId' "rpminstance.json")
@ -104,7 +104,7 @@ ansible-playbook \
-i /osbuild-composer/tools/appsre-ansible/inventory \
/osbuild-composer/tools/appsre-ansible/rpmbuild.yml \
-e "COMPOSER_COMMIT=$COMMIT_SHA" \
-e "OSBUILD_COMMIT=$(jq -r '.["rhel-8.5"].dependencies.osbuild.commit' /osbuild-composer/Schutzfile)" \
-e "OSBUILD_COMMIT=$(jq -r '.["rhel-8.6"].dependencies.osbuild.commit' /osbuild-composer/Schutzfile)" \
-e "RH_ACTIVATION_KEY=$RH_ACTIVATION_KEY" \
-e "RH_ORG_ID=$RH_ORG_ID"
EOF
@ -165,7 +165,7 @@ EOF
# get distro name for schutzfile
local schutzfile_distro="$distro"
if [[ $schutzfile_distro == rhel-8 ]]; then
schutzfile_distro=rhel-8.5
schutzfile_distro=rhel-8.6
fi
# get osbuild_commit from schutzfile