Skip to content

Commit

Permalink
Add module support to yamllint sanity test. (ansible#34964)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
mattclay authored Jan 16, 2018
1 parent 240024e commit 227ff61
Show file tree
Hide file tree
Showing 53 changed files with 533 additions and 344 deletions.
19 changes: 0 additions & 19 deletions .yamllint

This file was deleted.

1 change: 1 addition & 0 deletions .yamllint
5 changes: 0 additions & 5 deletions lib/ansible/modules/cloud/amazon/_ec2_ami_find.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,6 @@
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
Expand Down
2 changes: 0 additions & 2 deletions lib/ansible/modules/cloud/amazon/aws_api_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,13 @@

EXAMPLES = '''
# Update API resources for development
tasks:
- name: update API
aws_api_gateway:
api_id: 'abc123321cba'
state: present
swagger_file: my_api.yml
# update definitions and deploy API to production
tasks:
- name: deploy API
aws_api_gateway:
api_id: 'abc123321cba'
Expand Down
42 changes: 21 additions & 21 deletions lib/ansible/modules/cloud/amazon/aws_direct_connect_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,33 @@
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 = """
Expand Down
4 changes: 4 additions & 0 deletions lib/ansible/modules/cloud/amazon/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,19 +596,23 @@
#
# 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
Expand Down
3 changes: 0 additions & 3 deletions lib/ansible/modules/cloud/amazon/ec2_win_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@

EXAMPLES = '''
# Example of getting a password
tasks:
- name: get the Administrator password
ec2_win_password:
profile: my-boto-profile
Expand All @@ -73,7 +72,6 @@
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
Expand All @@ -83,7 +81,6 @@
key_passphrase: "secret"
# Example of waiting for a password
tasks:
- name: get the Administrator password
ec2_win_password:
profile: my-boto-profile
Expand Down
14 changes: 7 additions & 7 deletions lib/ansible/modules/cloud/amazon/iam_mfa_device_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
# 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:
Expand Down
3 changes: 0 additions & 3 deletions lib/ansible/modules/cloud/amazon/iam_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@

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
Expand All @@ -83,7 +82,6 @@
# 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
Expand All @@ -104,7 +102,6 @@
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
Expand Down
2 changes: 0 additions & 2 deletions lib/ansible/modules/cloud/amazon/lambda.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@

EXAMPLES = '''
# Create Lambda functions
tasks:
- name: looped creation
lambda:
name: '{{ item.name }}'
Expand Down Expand Up @@ -154,7 +153,6 @@
key2: "2"
# Basic Lambda function deletion
tasks:
- name: Delete Lambda functions HelloWorld and ByeBye
lambda:
name: '{{ item }}'
Expand Down
58 changes: 29 additions & 29 deletions lib/ansible/modules/cloud/cloudstack/cs_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,43 +104,43 @@

EXAMPLES = '''
# create an account in domain 'CUSTOMERS'
local_action:
module: cs_account
name: customer_xy
username: customer_xy
password: S3Cur3
last_name: Doe
first_name: John
email: [email protected]
domain: CUSTOMERS
- local_action:
module: cs_account
name: customer_xy
username: customer_xy
password: S3Cur3
last_name: Doe
first_name: John
email: [email protected]
domain: CUSTOMERS
# Lock an existing account in domain 'CUSTOMERS'
local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: locked
- local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: locked
# Disable an existing account in domain 'CUSTOMERS'
local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: disabled
- local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: disabled
# Enable an existing account in domain 'CUSTOMERS'
local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: enabled
- local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: enabled
# Remove an account in domain 'CUSTOMERS'
local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: absent
- local_action:
module: cs_account
name: customer_xy
domain: CUSTOMERS
state: absent
'''

RETURN = '''
Expand Down
5 changes: 0 additions & 5 deletions lib/ansible/modules/cloud/cloudstack/cs_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,6 @@
returned: success
type: string
sample: 2001:db8::1
state:
description: State of the network.
returned: success
type: string
sample: Implemented
zone:
description: Name of zone.
returned: success
Expand Down
20 changes: 10 additions & 10 deletions lib/ansible/modules/cloud/cloudstack/cs_network_acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,18 @@

EXAMPLES = '''
# create a network ACL
local_action:
module: cs_network_acl
name: Webserver ACL
description: a more detailed description of the ACL
vpc: customers
- local_action:
module: cs_network_acl
name: Webserver ACL
description: a more detailed description of the ACL
vpc: customers
# remove a network ACL
local_action:
module: cs_network_acl
name: Webserver ACL
vpc: customers
state: absent
- local_action:
module: cs_network_acl
name: Webserver ACL
vpc: customers
state: absent
'''

RETURN = '''
Expand Down
Loading

0 comments on commit 227ff61

Please sign in to comment.