diff --git a/awx_collection/plugins/modules/tower_credential.py b/awx_collection/plugins/modules/tower_credential.py index c57efc87d8a7..b91d020cda29 100644 --- a/awx_collection/plugins/modules/tower_credential.py +++ b/awx_collection/plugins/modules/tower_credential.py @@ -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: @@ -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: @@ -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: diff --git a/awx_collection/plugins/modules/tower_credential_type.py b/awx_collection/plugins/modules/tower_credential_type.py index 7d73250e6f03..5f1a3f505778 100644 --- a/awx_collection/plugins/modules/tower_credential_type.py +++ b/awx_collection/plugins/modules/tower_credential_type.py @@ -32,7 +32,6 @@ description: description: - The description of the credential type to give more detail about it. - required: False type: str kind: description: @@ -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 @@ -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') diff --git a/awx_collection/plugins/modules/tower_group.py b/awx_collection/plugins/modules/tower_group.py index 997a606b4f22..8bec2ae9897d 100644 --- a/awx_collection/plugins/modules/tower_group.py +++ b/awx_collection/plugins/modules/tower_group.py @@ -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: @@ -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 @@ -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') diff --git a/awx_collection/plugins/modules/tower_host.py b/awx_collection/plugins/modules/tower_host.py index d2e59ca67d95..16962ccc60d7 100644 --- a/awx_collection/plugins/modules/tower_host.py +++ b/awx_collection/plugins/modules/tower_host.py @@ -31,7 +31,6 @@ new_name: description: - To use when changing a hosts's name. - required: False type: str version_added: "3.7" description: @@ -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 @@ -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') diff --git a/awx_collection/plugins/modules/tower_inventory.py b/awx_collection/plugins/modules/tower_inventory.py index 32aa79615c5a..e3981ea68bac 100644 --- a/awx_collection/plugins/modules/tower_inventory.py +++ b/awx_collection/plugins/modules/tower_inventory.py @@ -40,7 +40,6 @@ variables: description: - Inventory variables. - required: False type: dict kind: description: @@ -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 @@ -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') diff --git a/awx_collection/plugins/modules/tower_inventory_source.py b/awx_collection/plugins/modules/tower_inventory_source.py index 48111b45b8a3..a2e65d2ee6ee 100644 --- a/awx_collection/plugins/modules/tower_inventory_source.py +++ b/awx_collection/plugins/modules/tower_inventory_source.py @@ -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: @@ -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. @@ -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. @@ -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. @@ -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 @@ -153,17 +148,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(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(), @@ -171,12 +166,12 @@ def main(): 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'), ) diff --git a/awx_collection/plugins/modules/tower_job_cancel.py b/awx_collection/plugins/modules/tower_job_cancel.py index e5cfe40f2f23..f3a852df2596 100644 --- a/awx_collection/plugins/modules/tower_job_cancel.py +++ b/awx_collection/plugins/modules/tower_job_cancel.py @@ -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 diff --git a/awx_collection/plugins/modules/tower_job_launch.py b/awx_collection/plugins/modules/tower_job_launch.py index 83ae5e58fea7..a9e61eee58bc 100644 --- a/awx_collection/plugins/modules/tower_job_launch.py +++ b/awx_collection/plugins/modules/tower_job_launch.py @@ -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 @@ -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 diff --git a/awx_collection/plugins/modules/tower_job_list.py b/awx_collection/plugins/modules/tower_job_list.py index f1a41fe8848c..f628ccc99c04 100644 --- a/awx_collection/plugins/modules/tower_job_list.py +++ b/awx_collection/plugins/modules/tower_job_list.py @@ -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 diff --git a/awx_collection/plugins/modules/tower_job_template.py b/awx_collection/plugins/modules/tower_job_template.py index 0581c3ba6a66..da6ba91dbcfd 100644 --- a/awx_collection/plugins/modules/tower_job_template.py +++ b/awx_collection/plugins/modules/tower_job_template.py @@ -39,7 +39,6 @@ job_type: description: - The job type to use for the job template. - required: False choices: ["run", "check"] type: str inventory: @@ -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=''), @@ -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') diff --git a/awx_collection/plugins/modules/tower_job_wait.py b/awx_collection/plugins/modules/tower_job_wait.py index 404db043b2d4..7e2eaa3cc061 100644 --- a/awx_collection/plugins/modules/tower_job_wait.py +++ b/awx_collection/plugins/modules/tower_job_wait.py @@ -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') diff --git a/awx_collection/plugins/modules/tower_label.py b/awx_collection/plugins/modules/tower_label.py index 848e28431ebf..96edf1a7f138 100644 --- a/awx_collection/plugins/modules/tower_label.py +++ b/awx_collection/plugins/modules/tower_label.py @@ -48,7 +48,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" extends_documentation_fragment: awx.awx.auth @@ -67,14 +66,14 @@ def main(): # Any additional arguments that are not fields of the item can be added here argument_spec = dict( - name=dict(required=True, type='str'), - new_name=dict(required=False, type='str'), - organization=dict(required=True, type='str'), + name=dict(required=True), + new_name=dict(), + organization=dict(required=True), state=dict(choices=['present'], 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') diff --git a/awx_collection/plugins/modules/tower_license.py b/awx_collection/plugins/modules/tower_license.py index f075cd457cfc..14c3c0a77981 100644 --- a/awx_collection/plugins/modules/tower_license.py +++ b/awx_collection/plugins/modules/tower_license.py @@ -37,7 +37,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" extends_documentation_fragment: awx.awx.auth diff --git a/awx_collection/plugins/modules/tower_notification.py b/awx_collection/plugins/modules/tower_notification.py index 1d31c0119544..613d38b71602 100644 --- a/awx_collection/plugins/modules/tower_notification.py +++ b/awx_collection/plugins/modules/tower_notification.py @@ -390,7 +390,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') diff --git a/awx_collection/plugins/modules/tower_organization.py b/awx_collection/plugins/modules/tower_organization.py index ebb3d7d0cc61..bb28c9ef2501 100644 --- a/awx_collection/plugins/modules/tower_organization.py +++ b/awx_collection/plugins/modules/tower_organization.py @@ -37,14 +37,12 @@ description: - Local absolute file path containing a custom Python virtualenv to use. type: str - required: False default: '' max_hosts: description: - The max hosts allowed in this organizations default: "0" type: int - required: False version_added: "3.7" state: description: @@ -55,7 +53,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" extends_documentation_fragment: awx.awx.auth @@ -85,15 +82,15 @@ 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), - description=dict(type='str', required=False), - custom_virtualenv=dict(type='str', required=False), - max_hosts=dict(type='int', required=False, default="0"), - state=dict(type='str', choices=['present', 'absent'], default='present', required=False), + name=dict(required=True), + description=dict(), + custom_virtualenv=dict(), + max_hosts=dict(type='int', default="0"), + 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') diff --git a/awx_collection/plugins/modules/tower_project.py b/awx_collection/plugins/modules/tower_project.py index 44245fd3522b..b9176601e54f 100644 --- a/awx_collection/plugins/modules/tower_project.py +++ b/awx_collection/plugins/modules/tower_project.py @@ -99,7 +99,6 @@ description: - Local absolute file path containing a custom Python virtualenv to use type: str - required: False default: '' organization: description: @@ -123,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 @@ -178,27 +176,27 @@ 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), - scm_type=dict(required=False, choices=['manual', 'git', 'hg', 'svn', 'insights'], default='manual'), - scm_url=dict(required=False), - local_path=dict(required=False), - scm_branch=dict(required=False, default=''), - scm_refspec=dict(required=False, default=''), - scm_credential=dict(required=False), - scm_clean=dict(required=False, type='bool', default=False), - scm_delete_on_update=dict(required=False, type='bool', default=False), - scm_update_on_launch=dict(required=False, type='bool', default=False), - scm_update_cache_timeout=dict(required=False, type='int', default=0), - scm_allow_override=dict(required=False, type='bool'), - job_timeout=dict(required=False, type='int', default=0), - custom_virtualenv=dict(required=False, type='str'), + description=dict(), + scm_type=dict(choices=['manual', 'git', 'hg', 'svn', 'insights'], default='manual'), + scm_url=dict(), + local_path=dict(), + scm_branch=dict(default=''), + scm_refspec=dict(default=''), + scm_credential=dict(), + scm_clean=dict(type='bool', default=False), + scm_delete_on_update=dict(type='bool', default=False), + scm_update_on_launch=dict(type='bool', default=False), + scm_update_cache_timeout=dict(type='int', default=0), + scm_allow_override=dict(type='bool'), + job_timeout=dict(type='int', default=0), + custom_virtualenv=dict(), organization=dict(required=True), - state=dict(required=False, choices=['present', 'absent'], default='present'), - wait=dict(required=False, type='bool', default=True), + state=dict(choices=['present', 'absent'], default='present'), + wait=dict(type='bool', default=True), ) # 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') diff --git a/awx_collection/plugins/modules/tower_role.py b/awx_collection/plugins/modules/tower_role.py index b7cf2c7e2ed7..698623bf6076 100644 --- a/awx_collection/plugins/modules/tower_role.py +++ b/awx_collection/plugins/modules/tower_role.py @@ -79,7 +79,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" @@ -119,7 +118,7 @@ def main(): state=dict(choices=['present', 'absent'], default='present'), ) - module = TowerModule(argument_spec=argument_spec, supports_check_mode=True) + module = TowerModule(argument_spec=argument_spec) role_type = module.params.pop('role') role_field = role_type + '_role' diff --git a/awx_collection/plugins/modules/tower_send.py b/awx_collection/plugins/modules/tower_send.py index dca252cc8b6f..da175978bfd9 100644 --- a/awx_collection/plugins/modules/tower_send.py +++ b/awx_collection/plugins/modules/tower_send.py @@ -27,19 +27,16 @@ description: - The assets to import. - This can be the output of tower_receive or loaded from a file - required: False type: str files: description: - List of files to import. - required: False default: [] type: list elements: str prevent: description: - A list of asset types to prevent import for - required: false default: [] type: list elements: str @@ -47,7 +44,6 @@ description: - The password management option to use. - The prompt option is not supported. - required: false default: 'default' choices: ["default", "random"] type: str @@ -98,10 +94,10 @@ def main(): argument_spec = dict( - assets=dict(required=False), - files=dict(required=False, default=[], type='list', elements='str'), - prevent=dict(required=False, default=[], type='list', elements='str'), - password_management=dict(required=False, default='default', choices=['default', 'random']), + assets=dict(), + files=dict(default=[], type='list', elements='str'), + prevent=dict(default=[], type='list', elements='str'), + password_management=dict(default='default', choices=['default', 'random']), ) module = TowerModule(argument_spec=argument_spec, supports_check_mode=False) diff --git a/awx_collection/plugins/modules/tower_settings.py b/awx_collection/plugins/modules/tower_settings.py index caf3cb0e56a5..034d898026bf 100644 --- a/awx_collection/plugins/modules/tower_settings.py +++ b/awx_collection/plugins/modules/tower_settings.py @@ -26,25 +26,21 @@ name: description: - Name of setting to modify - required: False type: str value: description: - Value to be modified for given setting. - If given a non-string type, will make best effort to cast it to type API expects. - For better control over types, use the C(settings) param instead. - required: False type: str settings: description: - A data structure to be sent into the settings endpoint - required: False type: dict version_added: "3.7" tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" requirements: @@ -112,9 +108,9 @@ def coerce_type(module, value): def main(): # Any additional arguments that are not fields of the item can be added here argument_spec = dict( - name=dict(required=False), - value=dict(required=False), - settings=dict(required=False, type='dict'), + name=dict(), + value=dict(), + settings=dict(type='dict'), ) # Create a module for ourselves diff --git a/awx_collection/plugins/modules/tower_team.py b/awx_collection/plugins/modules/tower_team.py index a8c6045a20c9..2c03d88b7c76 100644 --- a/awx_collection/plugins/modules/tower_team.py +++ b/awx_collection/plugins/modules/tower_team.py @@ -31,13 +31,11 @@ new_name: description: - To use when changing a team's name. - required: False type: str version_added: "3.7" description: description: - The description to use for the team. - required: False type: str organization: description: @@ -53,7 +51,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" extends_documentation_fragment: awx.awx.auth @@ -77,14 +74,14 @@ 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(), organization=dict(required=True), 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') diff --git a/awx_collection/plugins/modules/tower_user.py b/awx_collection/plugins/modules/tower_user.py index d6bd36f45a1e..92954d782429 100644 --- a/awx_collection/plugins/modules/tower_user.py +++ b/awx_collection/plugins/modules/tower_user.py @@ -31,36 +31,30 @@ first_name: description: - First name of the user. - required: False type: str last_name: description: - Last name of the user. - required: False type: str email: description: - Email address of the user. - required: False type: str is_superuser: description: - Designates that this user has all permissions without explicitly assigning them. - required: False type: bool default: False aliases: ['superuser'] is_system_auditor: description: - User is a system wide auditor. - required: False type: bool default: False aliases: ['auditor'] password: description: - Write-only field used to change the password. - required: False type: str state: description: @@ -71,7 +65,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" extends_documentation_fragment: awx.awx.auth @@ -121,18 +114,18 @@ def main(): # Any additional arguments that are not fields of the item can be added here argument_spec = dict( - username=dict(required=True, type='str'), - first_name=dict(required=False, type='str'), - last_name=dict(required=False, type='str'), - email=dict(required=False, type='str'), - is_superuser=dict(required=False, type='bool', default=False, aliases=['superuser']), - is_system_auditor=dict(required=False, type='bool', default=False, aliases=['auditor']), - password=dict(required=False, type='str', no_log=True), + username=dict(required=True), + first_name=dict(), + last_name=dict(), + email=dict(), + is_superuser=dict(type='bool', default=False, aliases=['superuser']), + is_system_auditor=dict(type='bool', default=False, aliases=['auditor']), + password=dict(no_log=True), 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 username = module.params.get('username') diff --git a/awx_collection/plugins/modules/tower_workflow_job_template.py b/awx_collection/plugins/modules/tower_workflow_job_template.py index 43b31ad65e64..1c9ec00f7477 100644 --- a/awx_collection/plugins/modules/tower_workflow_job_template.py +++ b/awx_collection/plugins/modules/tower_workflow_job_template.py @@ -32,69 +32,56 @@ new_name: description: - Setting this option will change the existing name. - required: False type: str description: description: - Optional description of this workflow job template. - required: False type: str extra_vars: description: - Variables which will be made available to jobs ran inside the workflow. - required: False type: dict organization: description: - Organization the workflow job template exists in. - Used to help lookup the object, cannot be modified using this module. - If not provided, will lookup by name only, which does not work with duplicates. - required: False type: str allow_simultaneous: description: - Allow simultaneous runs of the workflow job template. - required: False type: bool ask_variables_on_launch: description: - Prompt user for C(extra_vars) on launch. - required: False type: bool inventory: description: - Inventory applied as a prompt, assuming job template prompts for inventory - required: False type: str limit: description: - Limit applied as a prompt, assuming job template prompts for limit - required: False type: str scm_branch: description: - SCM branch applied as a prompt, assuming job template prompts for SCM branch - required: False type: str ask_inventory_on_launch: description: - Prompt user for inventory on launch of this workflow job template - required: False type: bool ask_scm_branch_on_launch: description: - Prompt user for SCM branch on launch of this workflow job template - required: False type: bool ask_limit_on_launch: description: - Prompt user for limit on launch of this workflow job template - required: False type: bool webhook_service: description: - Service that webhook requests will be accepted from - required: False type: str choices: - github @@ -102,7 +89,6 @@ webhook_credential: description: - Personal Access Token for posting back the status to the service API - required: False type: str survey_enabled: description: @@ -113,7 +99,6 @@ description: - The definition of the survey associated to the workflow. type: dict - required: false state: description: - Desired state of the resource. @@ -125,7 +110,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" extends_documentation_fragment: awx.awx.auth @@ -153,28 +137,28 @@ def update_survey(module, last_request): def main(): # Any additional arguments that are not fields of the item can be added here argument_spec = dict( - name=dict(required=True, type='str'), - new_name=dict(type='str'), - description=dict(type='str'), + name=dict(required=True), + new_name=dict(), + description=dict(), extra_vars=dict(type='dict'), - organization=dict(type='str'), + organization=dict(), survey=dict(type='dict'), # special handling survey_enabled=dict(type='bool'), allow_simultaneous=dict(type='bool'), ask_variables_on_launch=dict(type='bool'), - inventory=dict(type='str'), - limit=dict(type='str'), - scm_branch=dict(type='str'), + inventory=dict(), + limit=dict(), + scm_branch=dict(), ask_inventory_on_launch=dict(type='bool'), ask_scm_branch_on_launch=dict(type='bool'), ask_limit_on_launch=dict(type='bool'), - webhook_service=dict(type='str', choices=['github', 'gitlab']), - webhook_credential=dict(type='str'), + webhook_service=dict(choices=['github', 'gitlab']), + webhook_credential=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') diff --git a/awx_collection/plugins/modules/tower_workflow_job_template_node.py b/awx_collection/plugins/modules/tower_workflow_job_template_node.py index d78feb3505f1..500595c4516b 100644 --- a/awx_collection/plugins/modules/tower_workflow_job_template_node.py +++ b/awx_collection/plugins/modules/tower_workflow_job_template_node.py @@ -31,23 +31,19 @@ description: - Variables to apply at launch time. - Will only be accepted if job template prompts for vars or has a survey asking for those vars. - required: False type: dict default: {} inventory: description: - Inventory applied as a prompt, if job template prompts for inventory - required: False type: str scm_branch: description: - SCM branch applied as a prompt, if job template prompts for SCM branch - required: False type: str job_type: description: - Job type applied as a prompt, if job template prompts for job type - required: False type: str choices: - 'run' @@ -55,27 +51,22 @@ job_tags: description: - Job tags applied as a prompt, if job template prompts for job tags - required: False type: str skip_tags: description: - Tags to skip, applied as a prompt, if job tempalte prompts for job tags - required: False type: str limit: description: - Limit to act on, applied as a prompt, if job template prompts for limit - required: False type: str diff_mode: description: - Run diff mode, applied as a prompt, if job template prompts for diff mode - required: False type: bool verbosity: description: - Verbosity applied as a prompt, if job template prompts for verbosity - required: False type: str choices: - '0' @@ -96,19 +87,16 @@ description: - The organization of the workflow job template the node exists in. - Used for looking up the workflow, not a direct model field. - required: False type: str unified_job_template: description: - Name of unified job template to run in the workflow. - Can be a job template, project, inventory source, etc. - Omit if creating an approval node (not yet implemented). - required: False type: str all_parents_must_converge: description: - If enabled then the node will only run if all of the parent nodes have met the criteria to reach this node - required: False type: bool identifier: description: @@ -120,21 +108,18 @@ description: - Nodes that will run after this node completes. - List of node identifiers. - required: False type: list elements: str success_nodes: description: - Nodes that will run after this node on success. - List of node identifiers. - required: False type: list elements: str failure_nodes: description: - Nodes that will run after this node on failure. - List of node identifiers. - required: False type: list elements: str credentials: @@ -142,7 +127,6 @@ - Credentials to be applied to job as launch-time prompts. - List of credential names. - Uniqueness is not handled rigorously. - required: False type: list elements: str state: @@ -154,7 +138,6 @@ tower_oauthtoken: description: - The Tower OAuth token to use. - required: False type: str version_added: "3.7" extends_documentation_fragment: awx.awx.auth @@ -186,19 +169,19 @@ def main(): # Any additional arguments that are not fields of the item can be added here argument_spec = dict( - identifier=dict(required=True, type='str'), - workflow_job_template=dict(required=True, type='str', aliases=['workflow']), - organization=dict(type='str'), + identifier=dict(required=True), + workflow_job_template=dict(required=True, aliases=['workflow']), + organization=dict(), extra_data=dict(type='dict'), - inventory=dict(type='str'), - scm_branch=dict(type='str'), - job_type=dict(type='str', choices=['run', 'check']), - job_tags=dict(type='str'), - skip_tags=dict(type='str'), - limit=dict(type='str'), + inventory=dict(), + scm_branch=dict(), + job_type=dict(choices=['run', 'check']), + job_tags=dict(), + skip_tags=dict(), + limit=dict(), diff_mode=dict(type='bool'), - verbosity=dict(type='str', choices=['0', '1', '2', '3', '4', '5']), - unified_job_template=dict(type='str'), + verbosity=dict(choices=['0', '1', '2', '3', '4', '5']), + unified_job_template=dict(), all_parents_must_converge=dict(type='bool'), success_nodes=dict(type='list', elements='str'), always_nodes=dict(type='list', elements='str'), @@ -208,7 +191,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 identifier = module.params.get('identifier') diff --git a/awx_collection/plugins/modules/tower_workflow_launch.py b/awx_collection/plugins/modules/tower_workflow_launch.py index a1ba4ea943e5..b403205253f1 100644 --- a/awx_collection/plugins/modules/tower_workflow_launch.py +++ b/awx_collection/plugins/modules/tower_workflow_launch.py @@ -28,12 +28,10 @@ extra_vars: description: - Any extra vars required to launch the job. - required: False type: str wait: description: - Wait for the workflow to complete. - required: False default: True type: bool timeout: @@ -94,9 +92,9 @@ def main(): argument_spec = dict( workflow_template=dict(required=True), - extra_vars=dict(required=False), - wait=dict(required=False, default=True, type='bool'), - timeout=dict(required=False, default=None, type='int'), + extra_vars=dict(), + wait=dict(default=True, type='bool'), + timeout=dict(default=None, type='int'), ) module = TowerModule( diff --git a/awx_collection/plugins/modules/tower_workflow_template.py b/awx_collection/plugins/modules/tower_workflow_template.py index 1dfae3f8024a..0fbe1eef6167 100644 --- a/awx_collection/plugins/modules/tower_workflow_template.py +++ b/awx_collection/plugins/modules/tower_workflow_template.py @@ -78,7 +78,6 @@ description: - The definition of the survey associated to the workflow. type: dict - required: false state: description: - Desired state of the resource. @@ -128,16 +127,16 @@ def main(): argument_spec = dict( name=dict(required=True), - description=dict(required=False), - extra_vars=dict(type='dict', required=False), - organization=dict(required=False), - allow_simultaneous=dict(type='bool', required=False), - schema=dict(type='list', elements='dict', required=False), + description=dict(), + extra_vars=dict(type='dict'), + organization=dict(), + allow_simultaneous=dict(type='bool'), + schema=dict(type='list', elements='dict'), survey=dict(type='dict'), - survey_enabled=dict(type='bool', required=False), - inventory=dict(required=False), - ask_inventory=dict(type='bool', required=False), - ask_extra_vars=dict(type='bool', required=False), + survey_enabled=dict(type='bool'), + inventory=dict(), + ask_inventory=dict(type='bool'), + ask_extra_vars=dict(type='bool'), state=dict(choices=['present', 'absent'], default='present'), )