File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
- hosts : localhost
2
2
connection : local
3
3
vars :
4
- _ec2_whitelist :
5
- - " i-07c245fc7984e0927"
6
4
_ec2_filters :
7
5
- " running"
8
6
- " stopped"
7
+ - " pending"
8
+ - " shutting-down"
9
+ - " stopping"
9
10
_ec2_ebs_list_review : []
10
11
_ec2_untagged_list : []
11
12
roles :
30
31
- name : Generate list EC2 to review
31
32
set_fact :
32
33
_ec2_untagged_list : " {{ _ec2_untagged_list + [{ 'id' : item.instance_id, 'name' : item.tags.Name }] }}"
33
- when : item.instance_id not in _ec2_whitelist
34
+ when : item.instance_id not in aws_ec2_whitelist
34
35
with_items : " {{ _ec2_list_all.instances | difference(_ec2_list_mageops.instances) }}"
35
36
36
37
- name : Find unused EBS volumes
51
52
52
53
- name : Set _ec2_list_review
53
54
set_fact :
54
- _ec2_list_review : " {{ _ec2_list_review | default() + 'ID : ' + item.id {% if item.name is definied %} + ' Name : ' + item.name + {% endif %} '\n ' }}"
55
+ _ec2_list_review : " {{ _ec2_list_review | default() + 'ID : ' + item.id + ' Name : ' + item.name | default() '\n ' }}"
55
56
with_items : " {{ _ec2_untagged_list }}"
56
57
58
+
57
59
- name : Failed when some resources found
58
60
fail :
59
61
msg : " {% if (_ec2_ebs_list.volumes | length) > 0 %} EBS volumes to review: {{ _ec2_ebs_list_review | join(',') }} \n {% endif %} \
You can’t perform that action at this time.
0 commit comments