Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Sep 24, 2021
1 parent 0954679 commit 78fc2db
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/integration/targets/ec2_eip/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,25 @@
state: absent
name: '{{ resource_prefix }}-vpc'
cidr_block: '{{ vpc_cidr }}'

- name: Create an EIP outside a VPC
ec2_eip:
state: present
in_vpc: '{{ omit }}'
register: unbound_eip
- assert:
that:
- unbound_eip is successful
- unbound_eip is changed
- name: Release EIP
ec2_eip:
state: absent
public_ip: '{{ unbound_eip.public_ip }}'
register: release_unbound_eip
- assert:
that:
- release_unbound_eip is successful
- release_unbound_eip is changed
# =====================================================
always:
- name: Cleanup instance (by id)
Expand Down Expand Up @@ -735,6 +754,12 @@
public_ip: '{{ no_tagged_eip.public_ip }}'
when: no_tagged_eip is changed
ignore_errors: true
- name: Cleanup unbound_eip
ec2_eip:
state: absent
public_ip: '{{ unbound_eip.public_ip }}'
when: unbound_eip is changed
ignore_errors: true
- name: Cleanup VPC
ec2_vpc_net:
state: absent
Expand Down

0 comments on commit 78fc2db

Please sign in to comment.