cloudfront_distribution: fix restrictions (#37476)

pull/38248/head
Julien Vey 6 years ago committed by Will Thames
parent 68f81a6799
commit 63a8ae94a7

@ -1691,7 +1691,7 @@ class CloudFrontValidationManager(object):
rest not in geo_restriction_items])
valid_restrictions = ansible_list_to_cloudfront_list(geo_restriction_items)
valid_restrictions['restriction_type'] = geo_restriction.get('restriction_type')
return valid_restrictions
return {'geo_restriction': valid_restrictions}
except Exception as e:
self.module.fail_json_aws(e, msg="Error validating restrictions")

@ -53,6 +53,23 @@
that:
- 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
set_fact:
comment: "{{'ABCDEFabcdef123456'|shuffle|join }}"

Loading…
Cancel
Save