-
-
Notifications
You must be signed in to change notification settings - Fork 316
/
Copy pathmain.yml
67 lines (61 loc) · 2.15 KB
/
main.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
- hosts: localhost
gather_facts: false
vars_files:
- vars/main.yml
tasks:
- name: Ensure VPC exists via CloudFormation.
cloudformation:
stack_name: eks-example-vpc
state: present
region: "{{ aws_region }}"
profile: "{{ aws_profile }}"
disable_rollback: false
template: cloudformation/vpc.yml
template_parameters:
Region: "{{ aws_region }}"
tags:
stack: eks-example-vpc
application: eks-example
register: vpc_info
- name: Add to stack_outputs.
set_fact:
stack_outputs: "{{ stack_outputs | combine(vpc_info['stack_outputs']) }}"
- name: Ensure EKS Cluster exists via CloudFormation.
cloudformation:
stack_name: eks-example-cluster
state: present
region: "{{ aws_region }}"
profile: "{{ aws_profile }}"
disable_rollback: false
template: cloudformation/eks-cluster.yml
template_parameters:
ClusterName: "{{ eks_cluster_name }}"
KubernetesVersion: "{{ eks_kubernetes_version }}"
Subnets: "{{ stack_outputs.Subnets }}"
VpcId: "{{ stack_outputs.VpcId }}"
tags:
stack: eks-example-cluster
application: eks-example
register: eks_cluster_info
- name: Add to stack_outputs.
set_fact:
stack_outputs: "{{ stack_outputs | combine(eks_cluster_info['stack_outputs']) }}"
- name: Ensure EKS Node Group exists via CloudFormation.
cloudformation:
stack_name: eks-example-nodegroup
state: present
region: "{{ aws_region }}"
profile: "{{ aws_profile }}"
disable_rollback: false
template: cloudformation/eks-nodegroup.yml
template_parameters:
ClusterName: "{{ eks_cluster_name }}"
NodeGroupName: "{{ eks_nodegroup_name }}"
NodeGroupDesiredCapacity: "{{ eks_nodegroup_cluster_size }}"
NodeInstanceType: "{{ eks_nodegroup_instance_type }}"
Subnets: "{{ stack_outputs.Subnets }}"
tags:
stack: eks-example-nodegroup
application: eks-example
register: eks_nodegroup_info