Skip to content

Commit

Permalink
sanity: Doc fixes (ansible-collections#130)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde committed Jul 8, 2020
1 parent b62f68d commit eaabb3e
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 152 deletions.
12 changes: 8 additions & 4 deletions plugins/modules/aws_acm_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
module: aws_acm_info
short_description: Retrieve certificate information from AWS Certificate Manager service
version_added: 1.0.0
Expand Down Expand Up @@ -49,7 +49,7 @@
'''

EXAMPLES = '''
EXAMPLES = r'''
- name: obtain all ACM certificates
community.aws.aws_acm_info:
Expand All @@ -76,7 +76,7 @@
'''

RETURN = '''
RETURN = r'''
certificates:
description: A list of certificates
returned: always
Expand Down Expand Up @@ -268,7 +268,11 @@ def main():
argument_spec = dict(
certificate_arn=dict(aliases=['arn']),
domain_name=dict(aliases=['name']),
statuses=dict(type='list', choices=['PENDING_VALIDATION', 'ISSUED', 'INACTIVE', 'EXPIRED', 'VALIDATION_TIMED_OUT', 'REVOKED', 'FAILED']),
statuses=dict(
type='list',
elements='str',
choices=['PENDING_VALIDATION', 'ISSUED', 'INACTIVE', 'EXPIRED', 'VALIDATION_TIMED_OUT', 'REVOKED', 'FAILED']
),
tags=dict(type='dict'),
)
module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)
Expand Down
89 changes: 43 additions & 46 deletions plugins/modules/aws_batch_compute_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: aws_batch_compute_environment
version_added: 1.0.0
short_description: Manage AWS Batch Compute Environments
description:
- This module allows the management of AWS Batch Compute Environments.
It is idempotent and supports "Check" mode. Use module M(community.aws.aws_batch_compute_environment) to manage the compute
- It is idempotent and supports "Check" mode.
- Use module M(community.aws.aws_batch_compute_environment) to manage the compute
environment, M(community.aws.aws_batch_job_queue) to manage job queues, M(community.aws.aws_batch_job_definition) to manage job definitions.
author: Jon Meran (@jonmer85)
options:
compute_environment_name:
description:
- The name for your compute environment. Up to 128 letters (uppercase and lowercase), numbers, and underscores
are allowed.
- The name for your compute environment.
- Up to 128 letters (uppercase and lowercase), numbers, and underscores are allowed.
required: true
type: str
type:
Expand All @@ -39,7 +40,8 @@
type: str
compute_environment_state:
description:
- The state of the compute environment. If the state is ENABLED, then the compute environment accepts jobs
- The state of the compute environment.
- If the state is C(ENABLED), then the compute environment accepts jobs
from a queue and can scale out automatically based on queues.
default: "ENABLED"
choices: ["ENABLED", "DISABLED"]
Expand Down Expand Up @@ -108,7 +110,8 @@
bid_percentage:
description:
- The minimum percentage that a Spot Instance price must be when compared with the On-Demand price for that
instance type before instances are launched. For example, if your bid percentage is 20%, then the Spot price
instance type before instances are launched.
- For example, if your bid percentage is 20%, then the Spot price
must be below 20% of the current On-Demand price for that EC2 instance.
type: int
spot_iam_fleet_role:
Expand All @@ -124,45 +127,39 @@
'''

EXAMPLES = '''
---
- hosts: localhost
gather_facts: no
vars:
EXAMPLES = r'''
- name: My Batch Compute Environment
community.aws.aws_batch_compute_environment:
compute_environment_name: computeEnvironmentName
state: present
tasks:
- name: My Batch Compute Environment
community.aws.aws_batch_compute_environment:
compute_environment_name: computeEnvironmentName
state: present
region: us-east-1
compute_environment_state: ENABLED
type: MANAGED
compute_resource_type: EC2
minv_cpus: 0
maxv_cpus: 2
desiredv_cpus: 1
instance_types:
- optimal
subnets:
- my-subnet1
- my-subnet2
security_group_ids:
- my-sg1
- my-sg2
instance_role: arn:aws:iam::<account>:instance-profile/<role>
tags:
tag1: value1
tag2: value2
service_role: arn:aws:iam::<account>:role/service-role/<role>
register: aws_batch_compute_environment_action
- name: show results
debug:
var: aws_batch_compute_environment_action
region: us-east-1
compute_environment_state: ENABLED
type: MANAGED
compute_resource_type: EC2
minv_cpus: 0
maxv_cpus: 2
desiredv_cpus: 1
instance_types:
- optimal
subnets:
- my-subnet1
- my-subnet2
security_group_ids:
- my-sg1
- my-sg2
instance_role: arn:aws:iam::<account>:instance-profile/<role>
tags:
tag1: value1
tag2: value2
service_role: arn:aws:iam::<account>:role/service-role/<role>
register: aws_batch_compute_environment_action
- name: show results
debug:
var: aws_batch_compute_environment_action
'''

RETURN = '''
RETURN = r'''
---
output:
description: "returns what action was taken, whether something was changed, invocation and response"
Expand Down Expand Up @@ -229,9 +226,9 @@
type: dict
'''

import re
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import snake_dict_to_camel_dict, camel_dict_to_snake_dict
import re

try:
from botocore.exceptions import ClientError, BotoCoreError
Expand Down Expand Up @@ -459,10 +456,10 @@ def main():
minv_cpus=dict(type='int', required=True),
maxv_cpus=dict(type='int', required=True),
desiredv_cpus=dict(type='int'),
instance_types=dict(type='list', required=True),
instance_types=dict(type='list', required=True, elements='str'),
image_id=dict(),
subnets=dict(type='list', required=True),
security_group_ids=dict(type='list', required=True),
subnets=dict(type='list', required=True, elements='str'),
security_group_ids=dict(type='list', required=True, elements='str'),
ec2_key_pair=dict(),
instance_role=dict(required=True),
tags=dict(type='dict'),
Expand Down
21 changes: 10 additions & 11 deletions plugins/modules/aws_batch_job_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: aws_batch_job_definition
version_added: 1.0.0
short_description: Manage AWS Batch Job Definitions
description:
- This module allows the management of AWS Batch Job Definitions.
It is idempotent and supports "Check" mode. Use module M(community.aws.aws_batch_compute_environment) to manage the compute
- It is idempotent and supports "Check" mode.
- Use module M(community.aws.aws_batch_compute_environment) to manage the compute
environment, M(community.aws.aws_batch_job_queue) to manage job queues, M(community.aws.aws_batch_job_definition) to manage job definitions.
author: Jon Meran (@jonmer85)
options:
job_definition_arn:
Expand Down Expand Up @@ -178,7 +177,7 @@
'''

EXAMPLES = '''
EXAMPLES = r'''
---
- hosts: localhost
gather_facts: no
Expand Down Expand Up @@ -208,7 +207,7 @@
debug: var=job_definition_create_result
'''

RETURN = '''
RETURN = r'''
---
output:
description: "returns what action was taken, whether something was changed, invocation and response"
Expand Down Expand Up @@ -427,14 +426,14 @@ def main():
image=dict(required=True),
vcpus=dict(type='int', required=True),
memory=dict(type='int', required=True),
command=dict(type='list', default=[]),
command=dict(type='list', default=[], elements='str'),
job_role_arn=dict(),
volumes=dict(type='list', default=[]),
environment=dict(type='list', default=[]),
mount_points=dict(type='list', default=[]),
volumes=dict(type='list', default=[], elements='dict'),
environment=dict(type='list', default=[], elements='dict'),
mount_points=dict(type='list', default=[], elements='dict'),
readonly_root_filesystem=dict(),
privileged=dict(),
ulimits=dict(type='list', default=[]),
ulimits=dict(type='list', default=[], elements='dict'),
user=dict(),
attempts=dict(type='int')
)
Expand Down
51 changes: 22 additions & 29 deletions plugins/modules/aws_batch_job_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r'''
---
module: aws_batch_job_queue
version_added: 1.0.0
short_description: Manage AWS Batch Job Queues
description:
- This module allows the management of AWS Batch Job Queues.
It is idempotent and supports "Check" mode. Use module M(community.aws.aws_batch_compute_environment) to manage the compute
- It is idempotent and supports "Check" mode.
- Use module M(community.aws.aws_batch_compute_environment) to manage the compute
environment, M(community.aws.aws_batch_job_queue) to manage job queues, M(community.aws.aws_batch_job_definition) to manage job definitions.
author: Jon Meran (@jonmer85)
options:
job_queue_name:
Expand All @@ -32,7 +31,7 @@
type: str
job_queue_state:
description:
- The state of the job queue. If the job queue state is ENABLED , it is able to accept jobs.
- The state of the job queue. If the job queue state is ENABLED, it is able to accept jobs.
default: "ENABLED"
choices: ["ENABLED", "DISABLED"]
type: str
Expand Down Expand Up @@ -69,32 +68,26 @@
'''

EXAMPLES = '''
---
- hosts: localhost
gather_facts: no
vars:
- name: My Batch Job Queue
community.aws.aws_batch_job_queue:
job_queue_name: jobQueueName
state: present
tasks:
- name: My Batch Job Queue
community.aws.aws_batch_job_queue:
job_queue_name: jobQueueName
state: present
region: us-east-1
job_queue_state: ENABLED
priority: 1
compute_environment_order:
- order: 1
compute_environment: my_compute_env1
- order: 2
compute_environment: my_compute_env2
register: batch_job_queue_action
- name: show results
debug:
var: batch_job_queue_action
region: us-east-1
job_queue_state: ENABLED
priority: 1
compute_environment_order:
- order: 1
compute_environment: my_compute_env1
- order: 2
compute_environment: my_compute_env2
register: batch_job_queue_action
- name: show results
debug:
var: batch_job_queue_action
'''

RETURN = '''
RETURN = r'''
---
output:
description: "returns what action was taken, whether something was changed, invocation and response"
Expand Down Expand Up @@ -293,7 +286,7 @@ def main():
job_queue_name=dict(required=True),
job_queue_state=dict(required=False, default='ENABLED', choices=['ENABLED', 'DISABLED']),
priority=dict(type='int', required=True),
compute_environment_order=dict(type='list', required=True),
compute_environment_order=dict(type='list', required=True, elements='dict'),
)

module = AnsibleAWSModule(
Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/aws_codebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__metaclass__ = type


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

EXAMPLES = '''
EXAMPLES = r'''
# Note: These examples do not set authentication details, see the AWS Guide for details.
- community.aws.aws_codebuild:
Expand Down Expand Up @@ -191,7 +191,7 @@
state: present
'''

RETURN = '''
RETURN = r'''
project:
description: Returns the dictionary describing the code project configuration.
returned: success
Expand Down Expand Up @@ -379,7 +379,7 @@ def main():
service_role=dict(),
timeout_in_minutes=dict(type='int', default=60),
encryption_key=dict(),
tags=dict(type='list'),
tags=dict(type='list', elements='dict'),
vpc_config=dict(type='dict'),
state=dict(choices=['present', 'absent'], default='present')
)
Expand Down
Loading

0 comments on commit eaabb3e

Please sign in to comment.