Improve aws_ec2 plugin documentation (#37689)

* Better formatting
* More examples
pull/38646/head
Will Thames 6 years ago committed by ansibot
parent c9fb054bc8
commit 3b74dc2f6e

@ -56,8 +56,6 @@ DOCUMENTATION = '''
''' '''
EXAMPLES = ''' EXAMPLES = '''
simple_config_file:
plugin: aws_ec2 plugin: aws_ec2
boto_profile: aws_profile boto_profile: aws_profile
regions: # populate inventory with instances in these regions regions: # populate inventory with instances in these regions
@ -74,21 +72,28 @@ simple_config_file:
# ignores 403 errors rather than failing # ignores 403 errors rather than failing
strict_permissions: False strict_permissions: False
hostnames: hostnames:
- tag:Name=Tag1,Name=Tag2 - tag:Name=Tag1,Name=Tag2 # return specific hosts only
- tag:CustomDNSName - tag:CustomDNSName
- dns-name - dns-name
# constructed features may be used to create custom groups # keyed_groups may be used to create custom groups
strict: False strict: False
keyed_groups: keyed_groups:
# add e.g. x86_64 hosts to an arch_x86_64 group
- prefix: arch - prefix: arch
key: 'architecture' key: 'architecture'
value: 'x86_64' # add hosts to tag_Name_Value groups for each Name/Value tag pair
- prefix: tag - prefix: tag
key: tags key: tags
value: # add hosts to e.g. instance_type_z3_tiny
"Name": "Test" - prefix: instance_type
key: instance_type
# create security_groups_sg_abcd1234 group for each SG
- key: 'security_groups|json_query("[].group_id")'
prefix: 'security_groups'
# create a group for each value of the Application tag
- key: tag.Application
separator: ''
''' '''
from ansible.errors import AnsibleError, AnsibleParserError from ansible.errors import AnsibleError, AnsibleParserError

Loading…
Cancel
Save