-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
62 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
tests/integration/targets/ec2_eip/tasks/update_reverse_dns_record.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
- name: Test EIP allocation | ||
block: | ||
# ------------------------------------------------------------------------------------------ | ||
# Allocate EIP with reverse DNS record | ||
# ------------------------------------------------------------------------------------------ | ||
- name: Allocate a new EIP and modify it's reverse DNS record - check_mode | ||
amazon.aws.ec2_eip: | ||
state: present | ||
domain_name: "{{ test_domain }}" | ||
tags: "{{ eip_test_tags }}" | ||
register: eip | ||
check_mode: true | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- eip is changed | ||
|
||
- name: Ensure no new EIP was created | ||
ansible.builtin.include_tasks: tasks/common.yml | ||
vars: | ||
has_no_new_eip: true | ||
|
||
- name: Allocate a new EIP and modify it's reverse DNS record | ||
amazon.aws.ec2_eip: | ||
state: present | ||
domain_name: "{{ test_domain }}" | ||
tags: "{{ eip_test_tags }}" | ||
register: eip | ||
|
||
- ansible.builtin.assert: | ||
that: | ||
- eip is changed | ||
- eip.public_ip is defined and ( eip.public_ip | ansible.utils.ipaddr ) | ||
- eip.allocation_id is defined and eip.allocation_id.startswith("eipalloc-") | ||
- eip.update_reverse_dns_record_result is defined | ||
- eip.update_reverse_dns_record_result.address.ptr_record_update is defined | ||
- eip.update_reverse_dns_record_result.address.ptr_record_update.value == "{{ test_domain }}" | ||
|
||
always: | ||
- name: Delete EIP | ||
ansible.builtin.include_tasks: tasks/common.yml | ||
vars: | ||
delete_eips: true |