Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove field properties which are default values anyway #6472

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions awx_collection/plugins/modules/tower_credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@
organization:
description:
- Organization that should own the credential.
required: False
type: str
credential_type:
description:
- Name of credential type.
- Will be preferred over kind
required: False
version_added: "2.10"
type: str
inputs:
Expand All @@ -55,7 +53,6 @@
Credential inputs where the keys are var names used in templating.
Refer to the Ansible Tower documentation for example syntax.
- Any fields in this dict will take prescedence over any fields mentioned below (i.e. host, username, etc)
required: False
version_added: "2.9"
type: dict
user:
Expand Down Expand Up @@ -100,7 +97,6 @@
description:
- SSH private key content. To extract the content from a file path, use the lookup function (see examples).
- Deprecated, please use inputs
required: False
type: str
ssh_key_unlock:
description:
Expand Down
16 changes: 5 additions & 11 deletions awx_collection/plugins/modules/tower_credential_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
description:
description:
- The description of the credential type to give more detail about it.
required: False
type: str
kind:
description:
Expand All @@ -41,33 +40,28 @@
net can be used for creating credential types. Refer to the Ansible
for more information.
choices: [ 'ssh', 'vault', 'net', 'scm', 'cloud', 'insights' ]
required: False
type: str
inputs:
description:
- >-
Enter inputs using either JSON or YAML syntax. Refer to the Ansible
Tower documentation for example syntax.
required: False
type: dict
injectors:
description:
- >-
Enter injectors using either JSON or YAML syntax. Refer to the
Ansible Tower documentation for example syntax.
required: False
type: dict
state:
description:
- Desired state of the resource.
required: False
default: "present"
choices: ["present", "absent"]
type: str
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand Down Expand Up @@ -109,15 +103,15 @@ def main():
# Any additional arguments that are not fields of the item can be added here
argument_spec = dict(
name=dict(required=True),
description=dict(required=False),
kind=dict(required=False, choices=list(KIND_CHOICES.keys())),
inputs=dict(type='dict', required=False),
injectors=dict(type='dict', required=False),
description=dict(),
kind=dict(choices=list(KIND_CHOICES.keys())),
inputs=dict(type='dict'),
injectors=dict(type='dict'),
state=dict(choices=['present', 'absent'], default='present'),
)

# Create a module for ourselves
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
module = TowerModule(argument_spec=argument_spec)

# Extract our parameters
name = module.params.get('name')
Expand Down
12 changes: 4 additions & 8 deletions awx_collection/plugins/modules/tower_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,11 @@
hosts:
description:
- List of hosts that should be put in this group.
required: False
type: list
elements: str
children:
description:
- List of groups that should be nested inside in this group.
required: False
type: list
elements: str
aliases:
Expand All @@ -64,13 +62,11 @@
new_name:
description:
- A new name for this group (for renaming)
required: False
type: str
version_added: "3.7"
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand All @@ -95,17 +91,17 @@ def main():
# Any additional arguments that are not fields of the item can be added here
argument_spec = dict(
name=dict(required=True),
new_name=dict(required=False),
description=dict(required=False),
new_name=dict(),
description=dict(),
inventory=dict(required=True),
variables=dict(type='dict', required=False),
variables=dict(type='dict'),
hosts=dict(type='list', elements='str'),
children=dict(type='list', elements='str', aliases=['groups']),
state=dict(choices=['present', 'absent'], default='present'),
)

# Create a module for ourselves
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
module = TowerModule(argument_spec=argument_spec)

# Extract our parameters
name = module.params.get('name')
Expand Down
10 changes: 4 additions & 6 deletions awx_collection/plugins/modules/tower_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
new_name:
description:
- To use when changing a hosts's name.
required: False
type: str
version_added: "3.7"
description:
Expand Down Expand Up @@ -61,7 +60,6 @@
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand Down Expand Up @@ -89,16 +87,16 @@ def main():
# Any additional arguments that are not fields of the item can be added here
argument_spec = dict(
name=dict(required=True),
new_name=dict(required=False),
description=dict(required=False),
new_name=dict(),
description=dict(),
inventory=dict(required=True),
enabled=dict(type='bool', default=True),
variables=dict(type='dict', required=False),
variables=dict(type='dict'),
state=dict(choices=['present', 'absent'], default='present'),
)

# Create a module for ourselves
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
module = TowerModule(argument_spec=argument_spec)

# Extract our parameters
name = module.params.get('name')
Expand Down
8 changes: 3 additions & 5 deletions awx_collection/plugins/modules/tower_inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
variables:
description:
- Inventory variables.
required: False
type: dict
kind:
description:
Expand All @@ -63,7 +62,6 @@
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand All @@ -89,16 +87,16 @@ def main():
# Any additional arguments that are not fields of the item can be added here
argument_spec = dict(
name=dict(required=True),
description=dict(required=False),
description=dict(),
organization=dict(required=True),
variables=dict(type='dict', required=False),
variables=dict(type='dict'),
kind=dict(choices=['', 'smart'], default=''),
host_filter=dict(),
state=dict(choices=['present', 'absent'], default='present'),
)

# Create a module for ourselves
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
module = TowerModule(argument_spec=argument_spec)

# Extract our parameters
name = module.params.get('name')
Expand Down
17 changes: 6 additions & 11 deletions awx_collection/plugins/modules/tower_inventory_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
new_name:
description:
- A new name for this assets (will rename the asset)
required: False
type: str
version_added: "3.7"
description:
Expand All @@ -48,7 +47,6 @@
- The source to use for this group.
choices: [ "scm", "ec2", "gce", "azure_rm", "vmware", "satellite6", "cloudforms", "openstack", "rhv", "tower", "custom" ]
type: str
required: False
source_path:
description:
- For an SCM based inventory source, the source path points to the file within the repo to use as an inventory.
Expand All @@ -57,7 +55,6 @@
description:
- Inventory script to be used when group type is C(custom).
type: str
required: False
source_vars:
description:
- The variables or environment fields to apply to this source type.
Expand Down Expand Up @@ -92,7 +89,6 @@
description:
- Local absolute file path containing a custom Python virtualenv to use.
type: str
required: False
default: ''
timeout:
description: The amount of time (in seconds) to run before the task is canceled.
Expand Down Expand Up @@ -126,7 +122,6 @@
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand All @@ -153,30 +148,30 @@ def main():
# Any additional arguments that are not fields of the item can be added here
argument_spec = dict(
name=dict(required=True),
new_name=dict(type='str'),
description=dict(required=False),
new_name=dict(),
description=dict(),
inventory=dict(required=True),
#
# How do we handle manual and file? Tower does not seem to be able to activate them
#
source=dict(choices=["scm", "ec2", "gce",
"azure_rm", "vmware", "satellite6", "cloudforms",
"openstack", "rhv", "tower", "custom"], required=False),
"openstack", "rhv", "tower", "custom"]),
source_path=dict(),
source_script=dict(required=False),
source_script=dict(),
source_vars=dict(type='dict'),
credential=dict(),
source_regions=dict(),
instance_filters=dict(),
group_by=dict(),
overwrite=dict(type='bool'),
overwrite_vars=dict(type='bool'),
custom_virtualenv=dict(type='str', default=''),
custom_virtualenv=dict(default=''),
timeout=dict(type='int'),
verbosity=dict(type='int', choices=[0, 1, 2]),
update_on_launch=dict(type='bool'),
update_cache_timeout=dict(type='int'),
source_project=dict(type='str'),
source_project=dict(),
update_on_project_update=dict(type='bool'),
state=dict(choices=['present', 'absent'], default='present'),
)
Expand Down
1 change: 0 additions & 1 deletion awx_collection/plugins/modules/tower_job_cancel.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand Down
21 changes: 10 additions & 11 deletions awx_collection/plugins/modules/tower_job_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand Down Expand Up @@ -142,23 +141,23 @@
def main():
# Any additional arguments that are not fields of the item can be added here
argument_spec = dict(
name=dict(type='str', required=True, aliases=['job_template']),
job_type=dict(type='str', choices=['run', 'check']),
inventory=dict(type='str', default=None),
name=dict(required=True, aliases=['job_template']),
job_type=dict(choices=['run', 'check']),
inventory=dict(default=None),
# Credentials will be a str instead of a list for backwards compatability
credentials=dict(type='list', default=None, aliases=['credential'], elements='str'),
limit=dict(),
tags=dict(type='list', elements='str'),
extra_vars=dict(type='dict', required=False),
scm_branch=dict(type='str', required=False),
skip_tags=dict(type='list', required=False, elements='str'),
verbosity=dict(type='int', required=False, choices=[0, 1, 2, 3, 4, 5]),
diff_mode=dict(type='bool', required=False),
credential_passwords=dict(type='dict', required=False),
extra_vars=dict(type='dict'),
scm_branch=dict(),
skip_tags=dict(type='list', elements='str'),
verbosity=dict(type='int', choices=[0, 1, 2, 3, 4, 5]),
diff_mode=dict(type='bool'),
credential_passwords=dict(type='dict'),
)

# Create a module for ourselves
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
module = TowerModule(argument_spec=argument_spec)

optional_args = {}
# Extract our parameters
Expand Down
1 change: 0 additions & 1 deletion awx_collection/plugins/modules/tower_job_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
tower_oauthtoken:
description:
- The Tower OAuth token to use.
required: False
type: str
version_added: "3.7"
extends_documentation_fragment: awx.awx.auth
Expand Down
7 changes: 3 additions & 4 deletions awx_collection/plugins/modules/tower_job_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
job_type:
description:
- The job type to use for the job template.
required: False
choices: ["run", "check"]
type: str
inventory:
Expand Down Expand Up @@ -332,12 +331,12 @@ def main():
playbook=dict(),
credential=dict(default=''),
vault_credential=dict(default=''),
custom_virtualenv=dict(required=False),
custom_virtualenv=dict(),
credentials=dict(type='list', default=[], elements='str'),
forks=dict(type='int'),
limit=dict(default=''),
verbosity=dict(type='int', choices=[0, 1, 2, 3, 4], default=0),
extra_vars=dict(type='dict', required=False),
extra_vars=dict(type='dict'),
job_tags=dict(default=''),
force_handlers=dict(type='bool', default=False, aliases=['force_handlers_enabled']),
skip_tags=dict(default=''),
Expand Down Expand Up @@ -369,7 +368,7 @@ def main():
)

# Create a module for ourselves
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
module = TowerModule(argument_spec=argument_spec)

# Extract our parameters
name = module.params.get('name')
Expand Down
2 changes: 1 addition & 1 deletion awx_collection/plugins/modules/tower_job_wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def main():
)

# Create a module for ourselves
module = TowerModule(argument_spec=argument_spec, supports_check_mode=True)
module = TowerModule(argument_spec=argument_spec)

# Extract our parameters
job_id = module.params.get('job_id')
Expand Down
Loading