mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Reorganize integration tests:
- Move legacy tests into a separate directory. - Reduce common dependencies between targets.
This commit is contained in:
parent
896c4b42ba
commit
781fd7099a
513 changed files with 111 additions and 6 deletions
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
# defaults file for ec2_provision_isntances
|
||||
count: 1
|
4
test/legacy/roles/ec2_provision_instances/meta/main.yml
Normal file
4
test/legacy/roles/ec2_provision_instances/meta/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
dependencies:
|
||||
- prepare_tests
|
||||
- setup_sshkey
|
||||
- setup_ec2
|
49
test/legacy/roles/ec2_provision_instances/tasks/main.yml
Normal file
49
test/legacy/roles/ec2_provision_instances/tasks/main.yml
Normal file
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
# tasks file for ec2_provision_instances
|
||||
|
||||
# ============================================================
|
||||
# create a keypair using the ssh key
|
||||
|
||||
- name: create the keypair for ec2
|
||||
ec2_key:
|
||||
name: "{{ resource_prefix }}"
|
||||
region: "{{ ec2_region }}"
|
||||
ec2_access_key: "{{ ec2_access_key }}"
|
||||
ec2_secret_key: "{{ ec2_secret_key }}"
|
||||
key_material: "{{ key_material }}"
|
||||
wait: yes
|
||||
state: present
|
||||
|
||||
# ============================================================
|
||||
# create some instances for testing, and add them to a new
|
||||
# group ("ec2") for use later
|
||||
|
||||
- name: create ec2 instances for testing
|
||||
ec2:
|
||||
instance_type: t1.micro
|
||||
image: ami-fb8e9292
|
||||
group: default
|
||||
region: "{{ ec2_region }}"
|
||||
ec2_access_key: "{{ ec2_access_key }}"
|
||||
ec2_secret_key: "{{ ec2_secret_key }}"
|
||||
key_name: "{{ resource_prefix }}"
|
||||
wait: yes
|
||||
instance_tags:
|
||||
Name: "{{ resource_prefix }}"
|
||||
exact_count: "{{ count }}"
|
||||
count_tag:
|
||||
Name: "{{ resource_prefix }}"
|
||||
register: ec2_provision_result
|
||||
|
||||
- name: add ec2 instances to a new group
|
||||
add_host:
|
||||
hostname: "{{ item.public_ip }}"
|
||||
groups: "ec2"
|
||||
ansible_ssh_private_key_file: "{{ sshkey }}"
|
||||
with_items: ec2_provision_result.instances
|
||||
|
||||
- name: wait for the instances to become available
|
||||
wait_for:
|
||||
port: 22
|
||||
host: "{{ item.public_ip }}"
|
||||
with_items: ec2_provision_result.instances
|
Loading…
Add table
Add a link
Reference in a new issue