RedHatGov / redhatgov.workshops

This is a collection of Ansible-deployed workshop environments. Use it in combination with the student workbook content, from the repo at https://github.com/RedHatGov/redhatgov.github.io
http://redhatgov.io
65 stars 69 forks source link

enable auto-selection of RHEL and Windows AMIs #178

Closed jonathan-sturges closed 2 years ago

jonathan-sturges commented 2 years ago

This patch will auto-select the AMIs in whatever region you're authenticated to. For now, I only applied the change to ansible, but RHEL (and others?) would also need it. And the old default AMI variables are still there too, for now. One minor change is that the rhel_ver and win_ver variables now are a bit different in order to enable the AMI queries.

Give it a shot and let me know what you think.

benblasco commented 2 years ago

This change broke the RHEL AWS workshop deploy but doesn't appear to have been documented. The RHEL AMI config out of the box appears to have changed and is still under investigation.

One such issue: https://github.com/RedHatGov/redhatgov.workshops/issues/184

FYI @ajacocks

benblasco commented 2 years ago

According to the code here it is now using Cloud Access Images every time:

https://github.com/RedHatGov/redhatgov.workshops/blob/master/ansible_tower_aws/roles/aws.create/tasks/main.yml

    cmd: aws ec2 describe-images --owners 309956199498 --region "{{ region }}" --filters "Name=architecture,Values=x86_64" --filters "Name=name,Values={{ rhel_ver }}*x86_64*Access2*" --query 'Images[*].[Name,ImageId]' --output text  | sort -V | awk '$1 !~ /.*BETA.*/ && $1 !~ /.*GA.*/ {ami=$2} END{print ami}'

This breaks any workshop that is deployed on an account without cloud access enabled. The RHEL 8 workshop offers this option.