mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
cloudfront_distribution: fix restrictions (#37476)
This commit is contained in:
parent
68f81a6799
commit
63a8ae94a7
2 changed files with 18 additions and 1 deletions
|
@ -1691,7 +1691,7 @@ class CloudFrontValidationManager(object):
|
||||||
rest not in geo_restriction_items])
|
rest not in geo_restriction_items])
|
||||||
valid_restrictions = ansible_list_to_cloudfront_list(geo_restriction_items)
|
valid_restrictions = ansible_list_to_cloudfront_list(geo_restriction_items)
|
||||||
valid_restrictions['restriction_type'] = geo_restriction.get('restriction_type')
|
valid_restrictions['restriction_type'] = geo_restriction.get('restriction_type')
|
||||||
return valid_restrictions
|
return {'geo_restriction': valid_restrictions}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.module.fail_json_aws(e, msg="Error validating restrictions")
|
self.module.fail_json_aws(e, msg="Error validating restrictions")
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,23 @@
|
||||||
that:
|
that:
|
||||||
- update_origin_http_port.changed
|
- update_origin_http_port.changed
|
||||||
|
|
||||||
|
- name: update restrictions
|
||||||
|
cloudfront_distribution:
|
||||||
|
alias: "{{ cloudfront_alias }}"
|
||||||
|
restrictions:
|
||||||
|
geo_restriction:
|
||||||
|
restriction_type: "whitelist"
|
||||||
|
items:
|
||||||
|
- "US"
|
||||||
|
state: present
|
||||||
|
<<: *aws_connection_info
|
||||||
|
register: update_restrictions
|
||||||
|
|
||||||
|
- name: ensure restrictions was updated
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
- update_restrictions.changed
|
||||||
|
|
||||||
- name: set a random comment
|
- name: set a random comment
|
||||||
set_fact:
|
set_fact:
|
||||||
comment: "{{'ABCDEFabcdef123456'|shuffle|join }}"
|
comment: "{{'ABCDEFabcdef123456'|shuffle|join }}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue