Skip to content

Commit

Permalink
integrated tests : ipv6_enabled for cloudfront_distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
abikouo committed Apr 14, 2021
1 parent 50b4fbe commit db2ce10
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions tests/integration/targets/cloudfront_distribution/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,67 @@
- set_fact:
distribution_id: '{{ cf_distribution.id }}'

- name: ensure that default value of ipv6_enabled
assert:
that:
- cf_distribution.changed
- not cf_distribution.is_ipv6_enabled

- name: Update the distribution with tags
cloudfront_distribution:
state: present
distribution_id: "{{ distribution_id }}"
tags:
property: ansible
register: cf_update_tags

- name: ensure the 'ipv6_enabled' value has not changed
assert:
that:
- cf_update_tags.changed
- not cf_update_tags.is_ipv6_enabled

- name: Update the distribution ipv6_enabled set to true
cloudfront_distribution:
state: present
distribution_id: "{{ distribution_id }}"
ipv6_enabled: True
register: cf_update_ipv6

- name: ensure the 'ipv6_enabled' value has changed (new value is true)
assert:
that:
- cf_update_ipv6.changed
- cf_update_ipv6.is_ipv6_enabled

- name: Update the distribution with tags
cloudfront_distribution:
state: present
distribution_id: "{{ distribution_id }}"
tags:
test: integration
register: cf_update_tags

- name: ensure the 'ipv6_enabled' value has not changed (value remains true)
assert:
that:
- cf_update_tags.changed
- cf_update_tags.is_ipv6_enabled

- name: Test idempotency updating cloudfront_distribution with same value of ipv6_enabled
cloudfront_distribution:
state: present
distribution_id: "{{ distribution_id }}"
ipv6_enabled: True
register: cf_update_ipv6

- name: ensure the 'ipv6_enabled' value has changed (new value is true)
assert:
that:
# FixMe : idempotency issues
# - not cf_update_ipv6.changed
- cf_update_ipv6.is_ipv6_enabled

- name: re-run cloudfront distribution with same defaults
cloudfront_distribution:
distribution_id: "{{ distribution_id }}"
Expand Down

0 comments on commit db2ce10

Please sign in to comment.