diff --git a/inventory/group_vars/copr_all_instances_aws b/inventory/group_vars/copr_all_instances_aws new file mode 100644 index 0000000000..6888169ffe --- /dev/null +++ b/inventory/group_vars/copr_all_instances_aws @@ -0,0 +1,17 @@ +# Your requested instance type (a1.xlarge) is not supported in your requested Availability Zone (us-east-1a). +# Your requested instance type (a1.xlarge) is not supported in your requested Availability Zone (us-east-1d). +# Your requested instance type (a1.xlarge) is not supported in your requested Availability Zone (us-east-1f). + +aws_arch_subnets: + x86_64: + - subnet-0995f6a466849f4c3 + - subnet-08cadf5a14b530ac4 + - subnet-07b0b3168a353e3ee + - subnet-09c74a3e6420a206b + - subnet-01d4e967ab5e78005 + - subnet-05437ac82d63b6ef5 + + aarch64: + - subnet-0995f6a466849f4c3 + - subnet-08cadf5a14b530ac4 + - subnet-07b0b3168a353e3ee diff --git a/inventory/inventory b/inventory/inventory index a92f9631d4..9e2efb3ac7 100644 --- a/inventory/inventory +++ b/inventory/inventory @@ -907,6 +907,10 @@ copr_back_dev_aws copr_dist_git_dev_aws copr_keygen_dev_aws +[copr_all_instances_aws:children] +copr_aws +copr_dev_aws + # [copr_hypervisors_aarch64] # virthost-aarch64-os01.fedorainfracloud.org # virthost-aarch64-os02.fedorainfracloud.org diff --git a/roles/copr/backend/files/provision/spinup_aws_task.yml b/roles/copr/backend/files/provision/spinup_aws_task.yml index a864a3d730..55970b072f 100644 --- a/roles/copr/backend/files/provision/spinup_aws_task.yml +++ b/roles/copr/backend/files/provision/spinup_aws_task.yml @@ -1,5 +1,9 @@ - debug: msg="vm_name={{ vm_name }}" +- name: random subnet to overcome datacenter failures + set_fact: subnet_id={{ item }} + with_random_choice: "{{ aws_arch_subnets[arch] }}" + - name: Launch instance ec2: key_name: "{{ keypair }}" @@ -9,7 +13,7 @@ wait: true region: "{{ aws_region }}" # both x86_64 and aarch64 arches can be allocated in us-east-1c - vpc_subnet_id: subnet-0995f6a466849f4c3 + vpc_subnet_id: "{{ subnet_id }}" assign_public_ip: yes instance_tags: FedoraGroup: copr