/
tf_aws_ec2.yml
48 lines (45 loc) · 1.3 KB
/
tf_aws_ec2.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
---
# aws ec2 ansible dynamic inventory plugin
plugin: aws_ec2
regions:
- us-east-1
- us-west-2
# - us-east-2
# set strict to False
# if True this will make invalid entries
# a fatal error
strict: False
keyed_groups:
# each aws ec2 instance has it own instance tags. create
# a tag variable from those tags for ansible to use.
# if an EC2 tag:Name is acloudguru_machine, it'll be converted to the
# Ansible tag variable name as follows: tag_Name_acloudguru_machine
# which can then be passed as a variable value for the host via -e flag
- key: tags
prefix: tag
#
# the following keyed groups are from the aws url:
# https://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html#options
# below are some of the variable that can be used.
# an example for instance_type:
# aws_instance_type_t2_micro
- key: architecture
prefix: arch
- key: tags.Applications
separator: ''
- key: instance_type
prefix: aws_instance_type
- key: placement.region
prefix: aws_region
- key: image_id
prefix: aws_image
- key: hypervisor
prefix: aws_hypervisor
- key: 'security_groups|json_query("[].group_id")'
prefix: 'security_groups'
hostnames:
# a list in order of precedence for hostname variables.
#
- ip-address
- dns-name
- tag:Name