Add module support to yamllint sanity test. (#34964)

* Add module support to yamllint sanity test.
* Fix duplicate keys in module RETURN docs.
* Fix syntax in return_common docs fragment.
* Fix duplicate keys in module EXAMPLES docs.
This commit is contained in:
Matt Clay 2018-01-16 15:08:56 -08:00 committed by GitHub
parent 240024ea4a
commit 227ff61f9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 533 additions and 344 deletions

View file

@ -205,11 +205,6 @@ architecture:
returned: when AMI found
type: string
sample: "x86_64"
architecture:
description: architecture of image
returned: when AMI found
type: string
sample: "x86_64"
block_device_mapping:
description: block device mapping associated with image
returned: when AMI found

View file

@ -74,7 +74,6 @@ notes:
EXAMPLES = '''
# Update API resources for development
tasks:
- name: update API
aws_api_gateway:
api_id: 'abc123321cba'
@ -82,7 +81,6 @@ tasks:
swagger_file: my_api.yml
# update definitions and deploy API to production
tasks:
- name: deploy API
aws_api_gateway:
api_id: 'abc123321cba'

View file

@ -62,33 +62,33 @@ options:
EXAMPLES = """
# create a Direct Connect connection
aws_direct_connect_connection:
name: ansible-test-connection
state: present
location: EqDC2
link_aggregation_group: dxlag-xxxxxxxx
bandwidth: 1Gbps
register: dc
- aws_direct_connect_connection:
name: ansible-test-connection
state: present
location: EqDC2
link_aggregation_group: dxlag-xxxxxxxx
bandwidth: 1Gbps
register: dc
# disassociate the LAG from the connection
aws_direct_connect_connection:
state: present
connection_id: dc.connection.connection_id
location: EqDC2
bandwidth: 1Gbps
- aws_direct_connect_connection:
state: present
connection_id: dc.connection.connection_id
location: EqDC2
bandwidth: 1Gbps
# replace the connection with one with more bandwidth
aws_direct_connect_connection:
state: present
name: ansible-test-connection
location: EqDC2
bandwidth: 10Gbps
forced_update: True
- aws_direct_connect_connection:
state: present
name: ansible-test-connection
location: EqDC2
bandwidth: 10Gbps
forced_update: True
# delete the connection
aws_direct_connect_connection:
state: absent
name: ansible-test-connection
- aws_direct_connect_connection:
state: absent
name: ansible-test-connection
"""
RETURN = """

View file

@ -596,19 +596,23 @@ EXAMPLES = '''
#
# instances with tag foo
- ec2:
count_tag:
foo:
# instances with tag foo=bar
- ec2:
count_tag:
foo: bar
# instances with tags foo=bar & baz
- ec2:
count_tag:
foo: bar
baz:
# instances with tags foo & bar & baz=bang
- ec2:
count_tag:
- foo
- bar

View file

@ -64,7 +64,6 @@ notes:
EXAMPLES = '''
# Example of getting a password
tasks:
- name: get the Administrator password
ec2_win_password:
profile: my-boto-profile
@ -73,7 +72,6 @@ tasks:
key_file: "~/aws-creds/my_test_key.pem"
# Example of getting a password with a password protected key
tasks:
- name: get the Administrator password
ec2_win_password:
profile: my-boto-profile
@ -83,7 +81,6 @@ tasks:
key_passphrase: "secret"
# Example of waiting for a password
tasks:
- name: get the Administrator password
ec2_win_password:
profile: my-boto-profile

View file

@ -51,15 +51,15 @@ EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# List MFA devices (more details: http://docs.aws.amazon.com/IAM/latest/APIReference/API_ListMFADevices.html)
iam_mfa_device_facts:
register: mfa_devices
- iam_mfa_device_facts:
register: mfa_devices
# Assume an existing role (more details: http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html)
sts_assume_role:
mfa_serial_number: "{{ mfa_devices.mfa_devices[0].serial_number }}"
role_arn: "arn:aws:iam::123456789012:role/someRole"
role_session_name: "someRoleSession"
register: assumed_role
- sts_assume_role:
mfa_serial_number: "{{ mfa_devices.mfa_devices[0].serial_number }}"
role_arn: "arn:aws:iam::123456789012:role/someRole"
role_session_name: "someRoleSession"
register: assumed_role
'''
try:

View file

@ -72,7 +72,6 @@ extends_documentation_fragment:
EXAMPLES = '''
# Create a policy with the name of 'Admin' to the group 'administrators'
tasks:
- name: Assign a policy called Admin to the administrators group
iam_policy:
iam_type: group
@ -83,7 +82,6 @@ tasks:
# Advanced example, create two new groups and add a READ-ONLY policy to both
# groups.
task:
- name: Create Two Groups, Mario and Luigi
iam:
iam_type: group
@ -104,7 +102,6 @@ task:
with_items: "{{ new_groups.results }}"
# Create a new S3 policy with prefix per user
tasks:
- name: Create S3 policy from template
iam_policy:
iam_type: user

View file

@ -125,7 +125,6 @@ extends_documentation_fragment:
EXAMPLES = '''
# Create Lambda functions
tasks:
- name: looped creation
lambda:
name: '{{ item.name }}'
@ -154,7 +153,6 @@ tasks:
key2: "2"
# Basic Lambda function deletion
tasks:
- name: Delete Lambda functions HelloWorld and ByeBye
lambda:
name: '{{ item }}'