Skip to content

Commit

Permalink
Make the ami pattern generic to avoid searching for deprecated amis (a…
Browse files Browse the repository at this point in the history
…nsible-collections#2268)

SUMMARY


This fixes the failure seen in https://d04ed4904ec3d4928496-5828abdaefb23a8975ffbcdc8ff7f222.ssl.cf1.rackcdn.com/2227/82e7cd3fcc15efebea7c6fbbcb447e99449af9d3/check/integration-amazon.aws-1/baa1dcd/job-output.txt
TASK [Set image id, vpc cidr and subnet cidr] **********************************
2024-08-23 20:07:43.220507 | controller | task path: /home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/inventory_aws_ec2/playbooks/tasks/setup.yml:13
2024-08-23 20:07:43.220523 | controller | fatal: [127.0.0.1]: FAILED! => {
2024-08-23 20:07:43.222302 | controller |     "msg": "The task includes an option with an undefined variable. The error was: list object has no element 0\n\nThe error appears to be in '/home/zuul-worker/.ansible/collections/ansible_collections/amazon/aws/tests/integration/targets/inventory_aws_ec2/playbooks/tasks/setup.yml': line 13, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set image id, vpc cidr and subnet cidr\n  ^ here\n"
2024-08-23 20:07:43.222349 | controller | }

AMIs can be deprecated to indicate they are outdated or no longer actively maintained. Fedora-Cloud-Base-37-1.2.x86_64*  ami is not available.
ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
Reviewed-by: Alina Buzachis
  • Loading branch information
GomathiselviS authored Aug 29, 2024
1 parent db552aa commit 610fd8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_deperecated_ami.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
trivial:
- Make the ami pattern generic to avoid searching for deprecated amis.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
vars:
ami_details:
owner: 125523088429
name: Fedora-Cloud-Base-37-1.2.x86_64*
name: Fedora-Cloud-Base-37*
user_data: |
#!/bin/sh
sudo dnf install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
Expand All @@ -45,6 +45,7 @@
amazon.aws.ec2_ami_info:
owners: '{{ ami_details.owner | default("amazon") }}'
filters:
architecture: x86_64
name: "{{ ami_details.name }}"
register: ec2_amis
no_log: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
owner-id: "125523088429"
virtualization-type: hvm
root-device-type: ebs
name: Fedora-Cloud-Base-37-1.2.x86_64*
name: Fedora-Cloud-Base-37*
register: fedora_images

- name: Set image id, vpc cidr and subnet cidr
Expand Down

0 comments on commit 610fd8c

Please sign in to comment.