Validate EXAMPLES as YAML

This commit is contained in:
Matt Martz 2017-02-07 15:39:24 -06:00 committed by Toshio Kuratomi
commit 7c00346714
112 changed files with 441 additions and 381 deletions

View file

@ -105,14 +105,14 @@ EXAMPLES = '''
# It is assumed that their matching environment variables are set.
# Basic creation example:
ec2_vpc:
- ec2_vpc:
state: present
cidr_block: 172.23.0.0/16
resource_tags: { "Environment":"Development" }
region: us-west-2
# Full creation example with subnets and optional availability zones.
# The absence or presence of subnets deletes or creates them respectively.
ec2_vpc:
- ec2_vpc:
state: present
cidr_block: 172.22.0.0/16
resource_tags: { "Environment":"Development" }
@ -143,12 +143,12 @@ EXAMPLES = '''
register: vpc
# Removal of a VPC by id
ec2_vpc:
- ec2_vpc:
state: absent
vpc_id: vpc-aaaaaaa
region: us-west-2
If you have added elements not managed by this module, e.g. instances, NATs, etc then
the delete will fail until those dependencies are removed.
# If you have added elements not managed by this module, e.g. instances, NATs, etc then
# the delete will fail until those dependencies are removed.
'''

View file

@ -73,7 +73,7 @@ EXAMPLES = '''
# Facts are published in ansible_facts['cloudformation'][<stack_name>]
- debug:
msg: '{{ ansible_facts['cloudformation']['my-cloudformation-stack'] }}'
msg: "{{ ansible_facts['cloudformation']['my-cloudformation-stack'] }}"
# Get all stack information about a stack
- cloudformation_facts:

View file

@ -145,10 +145,10 @@ EXAMPLES = '''
# Facts are published in ansible_facts['cloudfront'][<distribution_name>]
- debug:
msg: '{{ ansible_facts['cloudfront']['my-cloudfront-distribution-id'] }}'
msg: "{{ ansible_facts['cloudfront']['my-cloudfront-distribution-id'] }}"
- debug:
msg: '{{ ansible_facts['cloudfront']['www.my-website.com'] }}'
msg: "{{ ansible_facts['cloudfront']['www.my-website.com'] }}"
# Get all information about an invalidation for a distribution.
- cloudfront_facts:

View file

@ -83,7 +83,8 @@ extends_documentation_fragment: aws
EXAMPLES = """
- name: enable cloudtrail
local_action: cloudtrail
local_action:
module: cloudtrail
state: enabled
name: main
s3_bucket_name: ourbucket
@ -91,7 +92,8 @@ EXAMPLES = """
region: us-east-1
- name: enable cloudtrail with different configuration
local_action: cloudtrail
local_action:
module: cloudtrail
state: enabled
name: main
s3_bucket_name: ourbucket2
@ -99,7 +101,8 @@ EXAMPLES = """
region: us-east-1
- name: remove cloudtrail
local_action: cloudtrail
local_action:
module: cloudtrail
state: disabled
name: main
region: us-east-1

View file

@ -182,15 +182,15 @@ EXAMPLES = '''
# Rolling ASG Updates
Below is an example of how to assign a new launch config to an ASG and terminate old instances.
All instances in "myasg" that do not have the launch configuration named "my_new_lc" will be terminated in
a rolling fashion with instances using the current launch configuration, "my_new_lc".
This could also be considered a rolling deploy of a pre-baked AMI.
If this is a newly created group, the instances will not be replaced since all instances
will have the current launch configuration.
# Below is an example of how to assign a new launch config to an ASG and terminate old instances.
#
# All instances in "myasg" that do not have the launch configuration named "my_new_lc" will be terminated in
# a rolling fashion with instances using the current launch configuration, "my_new_lc".
#
# This could also be considered a rolling deploy of a pre-baked AMI.
#
# If this is a newly created group, the instances will not be replaced since all instances
# will have the current launch configuration.
- name: create launch config
ec2_lc:
@ -213,8 +213,8 @@ will have the current launch configuration.
desired_capacity: 5
region: us-east-1
To only replace a couple of instances instead of all of them, supply a list
to "replace_instances":
# To only replace a couple of instances instead of all of them, supply a list
# to "replace_instances":
- ec2_asg:
name: myasg

View file

@ -175,7 +175,7 @@ EXAMPLES = '''
# Modify the interface to enable the delete_on_terminaton flag
- ec2_eni:
eni_id: {{ "eni.interface.id" }}
eni_id: "{{ eni.interface.id }}"
delete_on_termination: true
'''

View file

@ -90,7 +90,7 @@ EXAMPLES = '''
hostPort: 80
- name: busybox
command:
- "/bin/sh -c \"while true; do echo '<html> <head> <title>Amazon ECS Sample App</title> <style>body {margin-top: 40px; background-color: #333;} </style> </head><body> <div style=color:white;text-align:center> <h1>Amazon ECS Sample App</h1> <h2>Congratulations!</h2> <p>Your application is now running on a container in Amazon ECS.</p>' > top; /bin/date > date ; echo '</div></body></html>' > bottom; cat top date bottom > /usr/local/apache2/htdocs/index.html ; sleep 1; done\""
- /bin/sh -c "while true; do echo '<html><head><title>Amazon ECS Sample App</title></head><body><div><h1>Amazon ECS Sample App</h1><h2>Congratulations!</h2><p>Your application is now running on a container in Amazon ECS.</p>' > top; /bin/date > date ; echo '</div></body></html>' > bottom; cat top date bottom > /usr/local/apache2/htdocs/index.html ; sleep 1; done"
cpu: 10
entryPoint:
- sh

View file

@ -54,7 +54,7 @@ extends_documentation_fragment:
EXAMPLES = '''
# Add or change a subnet group
- elasticache_subnet_group
- elasticache_subnet_group:
state: present
name: norwegian-blue
description: My Fancy Ex Parrot Subnet Group

View file

@ -276,7 +276,7 @@ EXAMPLES = '''
wait: yes
# Reboot an instance and wait for it to become available again
- rds
- rds:
command: reboot
instance_name: database
wait: yes

View file

@ -67,7 +67,7 @@ EXAMPLES = '''
- 'subnet-bbbbb'
# Remove subnet group
redshift_subnet_group: >
- redshift_subnet_group:
state: absent
group_name: redshift-subnet
'''