-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstop_environment.yml
More file actions
33 lines (31 loc) · 806 Bytes
/
stop_environment.yml
File metadata and controls
33 lines (31 loc) · 806 Bytes
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
# Stop the instances with the following tag
# This will run on cron in the evening for certain environments
---
- name: Scale down instances in autoscaling groups for raven
hosts: localhost
connection: local
vars_files:
- vars/default.yml
tasks:
- action: ec2_facts
- ec2_asg:
name: "{{ item.name }}"
min_size: 0
max_size: 0
desired_capacity: 0
region: "{{ environment_region }}"
with_items: environment_asgs
- name: Stop all instances matching a certain tag
hosts: tag_{{ environment_tag }}_{{ env }}
vars_files:
- vars/default.yml
connection: local
roles:
- role: stop_servers
- name: Stop elasticache servers
hosts: localhost
vars_files:
- vars/default.yml
connection: local
roles:
- stop_elasticache