-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathprovision-elb-custom-healthcheks-asg-playbook.yml
80 lines (75 loc) · 1.96 KB
/
provision-elb-custom-healthcheks-asg-playbook.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
68
69
70
71
72
73
74
75
76
77
78
79
80
---
- hosts: localhost
connection: local
gather_facts: false
vars:
image: '{{ ami }}'
architecture: 'workshop-elb-custom-checks'
loadb: '{{ architecture }}-lb'
auto_sc: '{{ architecture }}-asg'
lc: '{{ architecture }}-lc'
vars_files:
- amiKeys.yml
- regionInfo.yml
tasks:
- name: ELB
ec2_elb_lb:
scheme: internal
aws_access_key: '{{ ami_access }}'
aws_secret_key: '{{ ami_secret }}'
name: '{{ loadb }}'
region: '{{ regi }}'
health_check:
ping_protocol: http
ping_port: 8080
ping_path: '/health'
response_timeout: 5
interval: 60
unhealthy_threshold: 2
healthy_threshold: 2
subnets: '{{ subnetID }}'
security_group_ids: '{{ elb_security_group_ids }}'
state: '{{ state }}'
listeners:
- protocol: http
load_balancer_port: 80
instance_port: 8080
- name: Launch Configuration
tags:
- lc
ec2_lc:
aws_access_key: '{{ ami_access }}'
aws_secret_key: '{{ ami_secret }}'
region: '{{regi}}'
name: '{{lc}}'
image_id: '{{ image }}'
key_name: '{{ keypair }}'
security_groups: '{{ group }}'
instance_type: t2.micro
volumes:
- device_name: /dev/sda1
volume_size: 100
device_type: io1
iops: 3000
delete_on_termination: true
user_data: '{{ bootstrap_content }}'
state: '{{ state }}'
- name: Auto-scaling Group
tags:
- asg
ec2_asg:
aws_access_key: '{{ ami_access }}'
aws_secret_key: '{{ ami_secret }}'
region: '{{ regi }}'
name: '{{ auto_sc }}'
load_balancers: '{{ loadb }}'
launch_config_name: '{{ lc }}'
min_size: 2
max_size: 4
desired_capacity: 2
vpc_zone_identifier: '{{ subnetID }}'
wait_for_instances: false
health_check_period: 300
health_check_type: ELB
tags: '{{ tags }}'
state: '{{ state }}'