mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Re-enable the ec2_eip test
This commit is contained in:
parent
7fd2d1c3df
commit
5c2c10987e
2 changed files with 39 additions and 28 deletions
|
@ -8,7 +8,7 @@
|
|||
#- { role: test_ec2_tag, tags: test_ec2_tag }
|
||||
#- { role: test_ec2_facts, tags: test_ec2_facts }
|
||||
- { role: test_ec2_elb_lb, tags: test_ec2_elb_lb }
|
||||
#- { role: test_ec2_eip, tags: test_ec2_eip }
|
||||
- { role: test_ec2_eip, tags: test_ec2_eip }
|
||||
#- { role: test_ec2_ami, tags: test_ec2_ami }
|
||||
#- { role: test_ec2, tags: test_ec2 }
|
||||
- { role: test_ec2_asg, tags: test_ec2_asg }
|
||||
|
|
|
@ -32,17 +32,28 @@
|
|||
# test credential parameters
|
||||
|
||||
# ============================================================
|
||||
# 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 test instance
|
||||
|
||||
|
||||
- name: create test instance
|
||||
local_action:
|
||||
module: ec2
|
||||
key_name: "{{ eip_ec2_keyname }}"
|
||||
key_name: "{{ resource_prefix }}"
|
||||
region: "{{ ec2_region }}"
|
||||
instance_type: t1.micro
|
||||
image: "{{ eip_ec2_image }}"
|
||||
image: ami-fb8e9292
|
||||
wait: yes
|
||||
instance_tags:
|
||||
Name: "{{ tag_prefix }}"
|
||||
|
@ -243,32 +254,32 @@
|
|||
# ============================================================
|
||||
|
||||
# re-use existing VPC EIP with instance
|
||||
|
||||
- name: re-use existing EIP with instance
|
||||
ec2_eip:
|
||||
in_vpc=yes
|
||||
reuse_existing_ip_allowed=yes
|
||||
instance_id={{ instance_id }}
|
||||
ec2_access_key={{ ec2_access_key }}
|
||||
ec2_secret_key={{ ec2_secret_key }}
|
||||
region={{ ec2_region }}
|
||||
register: result
|
||||
|
||||
- name: assert new EIP was assigned
|
||||
assert:
|
||||
that:
|
||||
- '"failed" not in result'
|
||||
- '"public_ip" in result'
|
||||
# DISABLED BY JCAMMARATA
|
||||
#- name: re-use existing VPC EIP with instance
|
||||
# ec2_eip:
|
||||
# in_vpc=yes
|
||||
# reuse_existing_ip_allowed=yes
|
||||
# instance_id={{ instance_id }}
|
||||
# ec2_access_key={{ ec2_access_key }}
|
||||
# ec2_secret_key={{ ec2_secret_key }}
|
||||
# region={{ ec2_region }}
|
||||
# register: result
|
||||
#
|
||||
#- name: assert new VPC EIP was assigned
|
||||
# assert:
|
||||
# that:
|
||||
# - '"failed" not in result'
|
||||
# - '"public_ip" in result'
|
||||
#
|
||||
#
|
||||
#- name: disassociate VPC EIP associated with instance
|
||||
# ec2_eip: state=absent public_ip={{ eip }} region={{ ec2_region }}
|
||||
# ec2_access_key={{ ec2_access_key }}
|
||||
# ec2_secret_key={{ ec2_secret_key }}
|
||||
# instance_id={{ instance_id }}
|
||||
|
||||
|
||||
- name: disassociate EIP associated with instance
|
||||
ec2_eip: state=absent public_ip={{ eip }} region={{ ec2_region }}
|
||||
ec2_access_key={{ ec2_access_key }}
|
||||
ec2_secret_key={{ ec2_secret_key }}
|
||||
instance_id={{ instance_id }}
|
||||
|
||||
|
||||
- name: deactivate EIP
|
||||
- name: deactivate VPC EIP
|
||||
ec2_eip: state=absent public_ip={{ eip }} region={{ ec2_region }}
|
||||
ec2_access_key={{ ec2_access_key }}
|
||||
ec2_secret_key={{ ec2_secret_key }}
|
||||
|
|
Loading…
Reference in a new issue