Skip to content

Commit

Permalink
Docs: sanity fixes (#133)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde authored Jul 15, 2020
1 parent 0b9b2dc commit 059cf9e
Show file tree
Hide file tree
Showing 63 changed files with 362 additions and 512 deletions.
12 changes: 6 additions & 6 deletions plugins/modules/cloudformation_stack_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: cloudformation_stack_set
version_added: 1.0.0
Expand Down Expand Up @@ -176,7 +176,7 @@
requirements: [ boto3>=1.6, botocore>=1.10.26 ]
'''

EXAMPLES = '''
EXAMPLES = r'''
- name: Create a stack set with instances in two accounts
community.aws.cloudformation_stack_set:
name: my-stack
Expand Down Expand Up @@ -215,7 +215,7 @@
- us-east-1
'''

RETURN = '''
RETURN = r'''
operations_log:
type: list
description: Most recent events in CloudFormation's event log. This may be from a previous run in some cases.
Expand Down Expand Up @@ -505,9 +505,9 @@ def main():
template=dict(type='path'),
template_url=dict(),
template_body=dict(),
capabilities=dict(type='list', choices=['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM']),
regions=dict(type='list'),
accounts=dict(type='list'),
capabilities=dict(type='list', elements='str', choices=['CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM']),
regions=dict(type='list', elements='str'),
accounts=dict(type='list', elements='str'),
failure_tolerance=dict(
type='dict',
default={},
Expand Down
18 changes: 9 additions & 9 deletions plugins/modules/cloudfront_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
version_added: 1.0.0
Expand Down Expand Up @@ -220,7 +220,7 @@
whitelisted_names:
type: list
elements: str
description: A list of coockies to forward to the origin for this cache behavior.
description: A list of cookies to forward to the origin for this cache behavior.
headers:
description:
- A list of headers to forward to the origin for this cache behavior.
Expand Down Expand Up @@ -337,7 +337,7 @@
whitelisted_names:
type: list
elements: str
description: A list of coockies to forward to the origin for this cache behavior.
description: A list of cookies to forward to the origin for this cache behavior.
headers:
description:
- A list of headers to forward to the origin for this cache behavior.
Expand Down Expand Up @@ -534,7 +534,7 @@
- A config element that is a complex object that describes how a distribution should restrict it's content.
suboptions:
geo_restriction:
description: Apply a restriciton based on the location of the requester.
description: Apply a restriction based on the location of the requester.
type: dict
suboptions:
restriction_type:
Expand Down Expand Up @@ -673,7 +673,7 @@
caller_reference: replaceable distribution
'''

RETURN = '''
RETURN = r'''
active_trusted_signers:
description: Key pair IDs that CloudFront is aware of for each trusted signer.
returned: always
Expand Down Expand Up @@ -2093,15 +2093,15 @@ def main():
tags=dict(type='dict', default={}),
purge_tags=dict(type='bool', default=False),
alias=dict(),
aliases=dict(type='list', default=[]),
aliases=dict(type='list', default=[], elements='str'),
purge_aliases=dict(type='bool', default=False),
default_root_object=dict(),
origins=dict(type='list'),
origins=dict(type='list', elements='dict'),
purge_origins=dict(type='bool', default=False),
default_cache_behavior=dict(type='dict'),
cache_behaviors=dict(type='list'),
cache_behaviors=dict(type='list', elements='dict'),
purge_cache_behaviors=dict(type='bool', default=False),
custom_error_responses=dict(type='list'),
custom_error_responses=dict(type='list', elements='dict'),
purge_custom_error_responses=dict(type='bool', default=False),
logging=dict(type='dict'),
price_class=dict(),
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/cloudfront_invalidation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
version_added: 1.0.0
Expand Down Expand Up @@ -58,7 +58,7 @@
'''

EXAMPLES = '''
EXAMPLES = r'''
- name: create a batch of invalidations using a distribution_id for a reference
community.aws.cloudfront_invalidation:
Expand All @@ -80,7 +80,7 @@
'''

RETURN = '''
RETURN = r'''
invalidation:
description: The invalidation's information.
returned: always
Expand Down Expand Up @@ -247,7 +247,7 @@ def main():
caller_reference=dict(),
distribution_id=dict(),
alias=dict(),
target_paths=dict(required=True, type='list')
target_paths=dict(required=True, type='list', elements='str')
)

module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=False, mutually_exclusive=[['distribution_id', 'alias']])
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/cloudwatchevent_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
required: false
'''

EXAMPLES = '''
EXAMPLES = r'''
- community.aws.cloudwatchevent_rule:
name: MyCronTask
schedule_expression: "cron(0 20 * * ? *)"
Expand All @@ -131,7 +131,7 @@
state: absent
'''

RETURN = '''
RETURN = r'''
rule:
description: CloudWatch Event rule data.
returned: success
Expand Down Expand Up @@ -430,7 +430,7 @@ def main():
default='present'),
description=dict(),
role_arn=dict(),
targets=dict(type='list', default=[]),
targets=dict(type='list', default=[], elements='dict'),
)
module = AnsibleAWSModule(argument_spec=argument_spec)

Expand Down
14 changes: 7 additions & 7 deletions plugins/modules/data_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: data_pipeline
version_added: 1.0.0
Expand Down Expand Up @@ -128,7 +128,7 @@
type: str
'''

EXAMPLES = '''
EXAMPLES = r'''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Create pipeline
Expand Down Expand Up @@ -180,7 +180,7 @@
'''

RETURN = '''
RETURN = r'''
changed:
description: whether the data pipeline has been modified
type: bool
Expand Down Expand Up @@ -278,7 +278,7 @@ def pipeline_field(client, dp_id, field):


def run_with_timeout(timeout, func, *func_args, **func_kwargs):
"""Run func with the provided args and kwargs, and wait utill
"""Run func with the provided args and kwargs, and wait until
timeout for truthy return value
:param int timeout: time to wait for status
Expand Down Expand Up @@ -607,13 +607,13 @@ def main():
name=dict(required=True),
version=dict(removed_at_date='2022-06-01', removed_from_collection='community.aws'),
description=dict(required=False, default=''),
objects=dict(required=False, type='list', default=[]),
parameters=dict(required=False, type='list', default=[]),
objects=dict(required=False, type='list', default=[], elements='dict'),
parameters=dict(required=False, type='list', default=[], elements='dict'),
timeout=dict(required=False, type='int', default=300),
state=dict(default='present', choices=['present', 'absent',
'active', 'inactive']),
tags=dict(required=False, type='dict', default={}),
values=dict(required=False, type='list', default=[])
values=dict(required=False, type='list', default=[], elements='dict')
)
)
module = AnsibleModule(argument_spec, supports_check_mode=False)
Expand Down
10 changes: 5 additions & 5 deletions plugins/modules/dynamodb_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: dynamodb_table
version_added: 1.0.0
Expand Down Expand Up @@ -121,7 +121,7 @@
'''

EXAMPLES = '''
EXAMPLES = r'''
- name: Create dynamo table with hash and range primary key
community.aws.dynamodb_table:
name: my-table
Expand Down Expand Up @@ -164,7 +164,7 @@
state: absent
'''

RETURN = '''
RETURN = r'''
table_status:
description: The current status of the table.
returned: success
Expand Down Expand Up @@ -196,12 +196,12 @@

try:
import botocore
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list, boto3_conn
HAS_BOTO3 = True
except ImportError:
HAS_BOTO3 = False

from ansible.module_utils.basic import AnsibleModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list, boto3_conn
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AnsibleAWSError, connect_to_aws, ec2_argument_spec, get_aws_connection_info


Expand Down Expand Up @@ -467,7 +467,7 @@ def main():
range_key_type=dict(default='STRING', type='str', choices=['STRING', 'NUMBER', 'BINARY']),
read_capacity=dict(default=1, type='int'),
write_capacity=dict(default=1, type='int'),
indexes=dict(default=[], type='list'),
indexes=dict(default=[], type='list', elements='dict'),
tags=dict(type='dict'),
wait_for_active_timeout=dict(default=60, type='int'),
))
Expand Down
30 changes: 15 additions & 15 deletions plugins/modules/ec2_asg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: ec2_asg
version_added: 1.0.0
Expand Down Expand Up @@ -241,7 +241,7 @@
'''

EXAMPLES = '''
EXAMPLES = r'''
# Basic configuration with Launch Configuration
- community.aws.ec2_asg:
Expand Down Expand Up @@ -348,7 +348,7 @@
propagate_at_launch: no
'''

RETURN = '''
RETURN = r'''
---
auto_scaling_group_name:
description: The unique name of the auto scaling group
Expand Down Expand Up @@ -540,8 +540,6 @@
except ImportError:
pass # will be detected by imported HAS_BOTO3

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule

ASG_ATTRIBUTES = ('AvailabilityZones', 'DefaultCooldown', 'DesiredCapacity',
'HealthCheckGracePeriod', 'HealthCheckType', 'LaunchConfigurationName',
'LoadBalancerNames', 'MaxInstanceLifetime', 'MaxSize', 'MinSize',
Expand Down Expand Up @@ -1678,9 +1676,9 @@ def asg_exists(connection):
def main():
argument_spec = dict(
name=dict(required=True, type='str'),
load_balancers=dict(type='list'),
target_group_arns=dict(type='list'),
availability_zones=dict(type='list'),
load_balancers=dict(type='list', elements='str'),
target_group_arns=dict(type='list', elements='str'),
availability_zones=dict(type='list', elements='str'),
launch_config_name=dict(type='str'),
launch_template=dict(
type='dict',
Expand All @@ -1706,20 +1704,20 @@ def main():
),
placement_group=dict(type='str'),
desired_capacity=dict(type='int'),
vpc_zone_identifier=dict(type='list'),
vpc_zone_identifier=dict(type='list', elements='str'),
replace_batch_size=dict(type='int', default=1),
replace_all_instances=dict(type='bool', default=False),
replace_instances=dict(type='list', default=[]),
replace_instances=dict(type='list', default=[], elements='str'),
lc_check=dict(type='bool', default=True),
lt_check=dict(type='bool', default=True),
wait_timeout=dict(type='int', default=300),
state=dict(default='present', choices=['present', 'absent']),
tags=dict(type='list', default=[]),
tags=dict(type='list', default=[], elements='dict'),
health_check_period=dict(type='int', default=300),
health_check_type=dict(default='EC2', choices=['EC2', 'ELB']),
default_cooldown=dict(type='int', default=300),
wait_for_instances=dict(type='bool', default=True),
termination_policies=dict(type='list', default='Default'),
termination_policies=dict(type='list', default='Default', elements='str'),
notification_topic=dict(type='str', default=None),
notification_types=dict(
type='list',
Expand All @@ -1728,9 +1726,10 @@ def main():
'autoscaling:EC2_INSTANCE_LAUNCH_ERROR',
'autoscaling:EC2_INSTANCE_TERMINATE',
'autoscaling:EC2_INSTANCE_TERMINATE_ERROR'
]
],
elements='str'
),
suspend_processes=dict(type='list', default=[]),
suspend_processes=dict(type='list', default=[], elements='str'),
metrics_collection=dict(type='bool', default=False),
metrics_granularity=dict(type='str', default='1Minute'),
metrics_list=dict(
Expand All @@ -1744,7 +1743,8 @@ def main():
'GroupStandbyInstances',
'GroupTerminatingInstances',
'GroupTotalInstances'
]
],
elements='str'
)
)

Expand Down
Loading

0 comments on commit 059cf9e

Please sign in to comment.