145b79ef0e
* ec2_instance/ec2_instance_info : Fixup sanity test errors * Move ec2_instance integration tests to use aws_defaults * Search for the AMI instead of hardcoding an AMI * Make our VPC CIDR variable * Remove AZ assumptions - no guarantees about specific AZs being available * Make sure we terminate instances when we're done with them. * Add a 10 second pause for IAM roles to become available before using them * Wait on instance changes by default * Switch out t2 instances for t3 they're cheaper and have more CPU available * Pull t3.nano instance info a little earlier * rework vpc_name and vpc_cidr a little * Mark ec2_instance tests unsupported for now, they take too long
54 lines
1.8 KiB
YAML
54 lines
1.8 KiB
YAML
---
|
|
# This test suite is currently marked "unsupported" because it takes too long to
|
|
# run within the 'shippable' test environment.
|
|
# If a test suite runs longer than around 15 minutes aws-terminator can start
|
|
# pulling resources created at the start of the test out from under it.
|
|
#
|
|
# ###############################################################################
|
|
#
|
|
# A Note about ec2 environment variable name preference:
|
|
# - EC2_URL -> AWS_URL
|
|
# - EC2_ACCESS_KEY -> AWS_ACCESS_KEY_ID -> AWS_ACCESS_KEY
|
|
# - EC2_SECRET_KEY -> AWS_SECRET_ACCESS_KEY -> AWX_SECRET_KEY
|
|
# - EC2_REGION -> AWS_REGION
|
|
#
|
|
|
|
- name: Wrap up all tests and setup AWS credentials
|
|
module_defaults:
|
|
group/aws:
|
|
aws_access_key: "{{ aws_access_key }}"
|
|
aws_secret_key: "{{ aws_secret_key }}"
|
|
security_token: "{{ security_token | default(omit) }}"
|
|
region: "{{ aws_region }}"
|
|
block:
|
|
|
|
- name: Find AMI to use
|
|
ec2_ami_info:
|
|
owners: 'amazon'
|
|
filters:
|
|
name: '{{ ec2_ami_name }}'
|
|
register: ec2_amis
|
|
- name: Set fact with latest AMI
|
|
vars:
|
|
latest_ami: '{{ ec2_amis.images | sort(attribute="creation_date") | last }}'
|
|
set_fact:
|
|
ec2_ami_image: '{{ latest_ami.image_id }}'
|
|
|
|
- include_tasks: version_fail_wrapper.yml
|
|
|
|
- include_tasks: env_setup.yml
|
|
|
|
- include_tasks: cpu_options.yml
|
|
- include_tasks: termination_protection.yml
|
|
- include_tasks: tags_and_vpc_settings.yml
|
|
- include_tasks: external_resource_attach.yml
|
|
- include_tasks: block_devices.yml
|
|
- include_tasks: default_vpc_tests.yml
|
|
- include_tasks: iam_instance_role.yml
|
|
- include_tasks: checkmode_tests.yml
|
|
- include_tasks: ebs_optimized.yml
|
|
- include_tasks: instance_no_wait.yml
|
|
|
|
always:
|
|
- include_tasks: env_cleanup.yml
|
|
when: aws_cleanup
|