-
Notifications
You must be signed in to change notification settings - Fork 3
/
cloudfront.yml
48 lines (40 loc) · 1.78 KB
/
cloudfront.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
# This playbook is run after CKAN-Stack & WAF cloudformation stacks.
- name: Cloudformation Playbook
hosts: local
connection: local
pre_tasks:
- name: get basic_facts
set_fact:
basic_fact={{ item }}
# ACMCertificateARN={{ item.ACMCertificateARN }}
# Domain={{ item.Domain }}
# CmsOrigin={{ item.CmsOrigin }}
when: item.Environment == Environment
with_items: "{{ basic_facts }}"
- name: set facts to environment from basic_fact
set_fact: "{{ item.key }}={{ item.value }}"
with_dict: "{{ basic_fact }}"
when: basic_fact is defined
- set_fact:
lambdaAtEdgestack_name: "{{ service_name }}-{{ Environment }}-CLOUDFRONT-LAMBDA-AT-EDGE"
acm_stack_name: "{{ service_name }}-{{ Environment }}-acm"
- name: Describe Lambda@Edge cloudformation stack in us-east-1
cloudformation_facts:
region: "us-east-1"
stack_name: "{{ lambdaAtEdgestack_name }}"
stack_resources: true
register: lambdaAtEdgeStack
- name: Describe acm cert cloudformation stack in us-east-1
cloudformation_facts:
region: "us-east-1"
stack_name: "{{ acm_stack_name }}"
stack_resources: true
register: acmUsEast1
- set_fact:
LambdaAtEdgeViewerRequestVersion: "{{ lambdaAtEdgeStack.ansible_facts.cloudformation[lambdaAtEdgestack_name].stack_outputs.VersionedLambdaFunction48e660f32023b }}"
LambdaAtEdgeOriginRequestVersion: "{{ lambdaAtEdgeStack.ansible_facts.cloudformation[lambdaAtEdgestack_name].stack_outputs.LambdaEdgeOriginFunctionVersion9cd5bfa }}"
ACMCertificateARNForUsEast1: "{{ acmUsEast1.ansible_facts.cloudformation[acm_stack_name].stack_outputs.AcmCert }}"
- include_vars: vars/cloudfront.var.yml
roles:
- ansible_cloudformation