appsre-ansible: support aarch64

make ansible playbooks arch-agnostic
extract embedded bash script into separate file with parameters
update packer template to support aarch64
Convert parts of bash script to python code that can start multi-arch instances to build RPMS
This commit is contained in:
Diaa Sami 2022-06-15 16:50:18 +02:00 committed by Ondřej Budai
parent b03a131f13
commit ec0a1944b4
7 changed files with 289 additions and 80 deletions

View file

@ -0,0 +1,5 @@
---
# this is just a template!
# the actual content is generated by build/appsre-build-worker-packer.sh
rpmrepo_distribution: distro
osbuild_commit: abcdef

View file

@ -96,7 +96,7 @@
- rpmcopy
ansible.posix.synchronize:
mode: push
src: "{{ playbook_dir }}/roles/common/files/rpmbuild/RPMS"
src: "{{ playbook_dir }}/roles/common/files/rpmbuild/{{ ansible_architecture }}/RPMS"
dest: /tmp/rpmbuild
- name: Add repo config

View file

@ -55,6 +55,36 @@ build {
}
}
source "amazon-ebs.image_builder" {
name = "rhel-8-aarch64"
# Use a static RHEL 8.6 Cloud Access Image.
source_ami = "ami-0c84d76d81209a0e2"
ssh_username = "ec2-user"
instance_type = "c6g.large"
# Set a name for the resulting AMI.
ami_name = "${var.image_name}"
# Apply tags to the resulting AMI/EBS snapshot.
tags = {
AppCode = "IMGB-001"
Name = "${var.image_name}"
composer_commit = "${var.composer_commit}"
os = "rhel"
os_version = "8"
arch = "aarch64"
}
# Ensure that the EBS snapshot used for the AMI meets our requirements.
launch_block_device_mappings {
delete_on_termination = "true"
device_name = "/dev/sda1"
volume_size = 10
volume_type = "gp2"
}
}
source "amazon-ebs.image_builder" {
name = "fedora-35-x86_64"