diff --git a/awx_collection/plugins/doc_fragments/auth.py b/awx_collection/plugins/doc_fragments/auth.py index bf0ea28832..3763fafd80 100644 --- a/awx_collection/plugins/doc_fragments/auth.py +++ b/awx_collection/plugins/doc_fragments/auth.py @@ -28,6 +28,12 @@ options: - Password for your Tower or AWX instance. - If value not set, will try environment variable C(TOWER_PASSWORD) and then config files type: str + tower_oauthtoken: + description: + - The Tower OAuth token to use. + - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files + type: str + version_added: "3.7" validate_certs: description: - Whether to allow insecure connections to Tower or AWX. diff --git a/awx_collection/plugins/doc_fragments/auth_legacy.py b/awx_collection/plugins/doc_fragments/auth_legacy.py new file mode 100644 index 0000000000..bf0ea28832 --- /dev/null +++ b/awx_collection/plugins/doc_fragments/auth_legacy.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +# Copyright: (c) 2017, Wayne Witzel III +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + + +class ModuleDocFragment(object): + + # Ansible Tower documentation fragment + DOCUMENTATION = r''' +options: + tower_host: + description: + - URL to your Tower or AWX instance. + - If value not set, will try environment variable C(TOWER_HOST) and then config files + - If value not specified by any means, the value of C(127.0.0.1) will be used + type: str + tower_username: + description: + - Username for your Tower or AWX instance. + - If value not set, will try environment variable C(TOWER_USERNAME) and then config files + type: str + tower_password: + description: + - Password for your Tower or AWX instance. + - If value not set, will try environment variable C(TOWER_PASSWORD) and then config files + type: str + validate_certs: + description: + - Whether to allow insecure connections to Tower or AWX. + - If C(no), SSL certificates will not be validated. + - This should only be used on personally controlled sites using self-signed certificates. + - If value not set, will try environment variable C(TOWER_VERIFY_SSL) and then config files + type: bool + aliases: [ tower_verify_ssl ] + tower_config_file: + description: + - Path to the Tower or AWX config file. + - If provided, the other locations for config files will not be considered. + type: path + +notes: +- If no I(config_file) is provided we will attempt to use the tower-cli library + defaults to find your Tower host information. +- I(config_file) should contain Tower configuration in the following format + host=hostname + username=username + password=password +''' diff --git a/awx_collection/plugins/modules/tower_credential.py b/awx_collection/plugins/modules/tower_credential.py index 5a260f0ef3..12a6e930ff 100644 --- a/awx_collection/plugins/modules/tower_credential.py +++ b/awx_collection/plugins/modules/tower_credential.py @@ -184,13 +184,6 @@ options: choices: ["present", "absent"] default: "present" type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - required: False - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth diff --git a/awx_collection/plugins/modules/tower_credential_type.py b/awx_collection/plugins/modules/tower_credential_type.py index 71ecc81526..57ae60c6c3 100644 --- a/awx_collection/plugins/modules/tower_credential_type.py +++ b/awx_collection/plugins/modules/tower_credential_type.py @@ -59,12 +59,6 @@ options: default: "present" choices: ["present", "absent"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_group.py b/awx_collection/plugins/modules/tower_group.py index ec76ca40ad..e8ce833cca 100644 --- a/awx_collection/plugins/modules/tower_group.py +++ b/awx_collection/plugins/modules/tower_group.py @@ -64,12 +64,6 @@ options: - A new name for this group (for renaming) type: str version_added: "3.7" - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_host.py b/awx_collection/plugins/modules/tower_host.py index 27e4f5a048..3cefc3bad6 100644 --- a/awx_collection/plugins/modules/tower_host.py +++ b/awx_collection/plugins/modules/tower_host.py @@ -57,12 +57,6 @@ options: choices: ["present", "absent"] default: "present" type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_inventory.py b/awx_collection/plugins/modules/tower_inventory.py index 151fa07232..bfada2596e 100644 --- a/awx_collection/plugins/modules/tower_inventory.py +++ b/awx_collection/plugins/modules/tower_inventory.py @@ -59,12 +59,6 @@ options: default: "present" choices: ["present", "absent"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_inventory_source.py b/awx_collection/plugins/modules/tower_inventory_source.py index 99b9dbb00e..c17751fa96 100644 --- a/awx_collection/plugins/modules/tower_inventory_source.py +++ b/awx_collection/plugins/modules/tower_inventory_source.py @@ -119,12 +119,6 @@ options: default: "present" choices: ["present", "absent"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" notification_templates_started: description: - list of notifications to send on start diff --git a/awx_collection/plugins/modules/tower_job_cancel.py b/awx_collection/plugins/modules/tower_job_cancel.py index 867a81083c..c88ce3e935 100644 --- a/awx_collection/plugins/modules/tower_job_cancel.py +++ b/awx_collection/plugins/modules/tower_job_cancel.py @@ -33,12 +33,6 @@ options: - Fail loudly if the I(job_id) can not be canceled default: False type: bool - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - 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 6eec83b163..325e7fcfbd 100644 --- a/awx_collection/plugins/modules/tower_job_launch.py +++ b/awx_collection/plugins/modules/tower_job_launch.py @@ -87,12 +87,6 @@ options: - Passwords for credentials which are set to prompt on launch type: dict version_added: "3.7" - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_job_list.py b/awx_collection/plugins/modules/tower_job_list.py index 1bab24cf24..9723fa774f 100644 --- a/awx_collection/plugins/modules/tower_job_list.py +++ b/awx_collection/plugins/modules/tower_job_list.py @@ -41,12 +41,6 @@ options: description: - Query used to further filter the list of jobs. C({"foo":"bar"}) will be passed at C(?foo=bar) type: dict - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - 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 3dc8bbb13a..6b8710310d 100644 --- a/awx_collection/plugins/modules/tower_job_template.py +++ b/awx_collection/plugins/modules/tower_job_template.py @@ -268,12 +268,6 @@ options: default: "present" choices: ["present", "absent"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" notification_templates_started: description: - list of notifications to send on start diff --git a/awx_collection/plugins/modules/tower_job_wait.py b/awx_collection/plugins/modules/tower_job_wait.py index 84a24bc77c..6e954db561 100644 --- a/awx_collection/plugins/modules/tower_job_wait.py +++ b/awx_collection/plugins/modules/tower_job_wait.py @@ -49,13 +49,6 @@ options: description: - Maximum time in seconds to wait for a job to finish. type: int - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - required: False - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_label.py b/awx_collection/plugins/modules/tower_label.py index f1496b053e..0d3a5a2dad 100644 --- a/awx_collection/plugins/modules/tower_label.py +++ b/awx_collection/plugins/modules/tower_label.py @@ -45,12 +45,6 @@ options: default: "present" choices: ["present"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_license.py b/awx_collection/plugins/modules/tower_license.py index 95b0796e7e..8f3a806720 100644 --- a/awx_collection/plugins/modules/tower_license.py +++ b/awx_collection/plugins/modules/tower_license.py @@ -34,12 +34,6 @@ options: required: True type: bool version_added: "3.7" - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - 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 52d9ccaa5f..c4325f4a9e 100644 --- a/awx_collection/plugins/modules/tower_notification.py +++ b/awx_collection/plugins/modules/tower_notification.py @@ -210,12 +210,6 @@ options: default: "present" choices: ["present", "absent"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - version_added: "3.7" - type: str extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_organization.py b/awx_collection/plugins/modules/tower_organization.py index 84f56c6c7f..71238e1681 100644 --- a/awx_collection/plugins/modules/tower_organization.py +++ b/awx_collection/plugins/modules/tower_organization.py @@ -50,12 +50,6 @@ options: default: "present" choices: ["present", "absent"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" notification_templates_started: description: - list of notifications to send on start diff --git a/awx_collection/plugins/modules/tower_project.py b/awx_collection/plugins/modules/tower_project.py index 02d32f177b..5ef35539e8 100644 --- a/awx_collection/plugins/modules/tower_project.py +++ b/awx_collection/plugins/modules/tower_project.py @@ -121,12 +121,6 @@ options: on the project may be successfully created type: bool default: True - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" notification_templates_started: description: - list of notifications to send on start diff --git a/awx_collection/plugins/modules/tower_receive.py b/awx_collection/plugins/modules/tower_receive.py index 0411ff19f2..bdce881ba7 100644 --- a/awx_collection/plugins/modules/tower_receive.py +++ b/awx_collection/plugins/modules/tower_receive.py @@ -105,7 +105,7 @@ requirements: notes: - Specifying a name of "all" for any asset type will export all items of that asset type. -extends_documentation_fragment: awx.awx.auth +extends_documentation_fragment: awx.awx.auth_legacy ''' EXAMPLES = ''' diff --git a/awx_collection/plugins/modules/tower_role.py b/awx_collection/plugins/modules/tower_role.py index fc0266fb8e..2b23a85004 100644 --- a/awx_collection/plugins/modules/tower_role.py +++ b/awx_collection/plugins/modules/tower_role.py @@ -76,15 +76,6 @@ options: default: "present" choices: ["present", "absent"] type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" - -requirements: -- ansible-tower-cli >= 3.0.2 extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_send.py b/awx_collection/plugins/modules/tower_send.py index f8f8243f30..6747a27002 100644 --- a/awx_collection/plugins/modules/tower_send.py +++ b/awx_collection/plugins/modules/tower_send.py @@ -60,7 +60,7 @@ requirements: - six.moves.StringIO - sys -extends_documentation_fragment: awx.awx.auth +extends_documentation_fragment: awx.awx.auth_legacy ''' EXAMPLES = ''' diff --git a/awx_collection/plugins/modules/tower_settings.py b/awx_collection/plugins/modules/tower_settings.py index b761f5cccc..b7ecde45ef 100644 --- a/awx_collection/plugins/modules/tower_settings.py +++ b/awx_collection/plugins/modules/tower_settings.py @@ -38,12 +38,6 @@ options: - A data structure to be sent into the settings endpoint type: dict version_added: "3.7" - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" requirements: - pyyaml extends_documentation_fragment: awx.awx.auth diff --git a/awx_collection/plugins/modules/tower_team.py b/awx_collection/plugins/modules/tower_team.py index d7af5a616d..bb8a89d570 100644 --- a/awx_collection/plugins/modules/tower_team.py +++ b/awx_collection/plugins/modules/tower_team.py @@ -48,12 +48,6 @@ options: choices: ["present", "absent"] default: "present" type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_user.py b/awx_collection/plugins/modules/tower_user.py index f2f6b1fc31..d710ed8a6d 100644 --- a/awx_collection/plugins/modules/tower_user.py +++ b/awx_collection/plugins/modules/tower_user.py @@ -62,12 +62,6 @@ options: choices: ["present", "absent"] default: "present" type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_workflow_job_template.py b/awx_collection/plugins/modules/tower_workflow_job_template.py index fa4ed61674..402933461e 100644 --- a/awx_collection/plugins/modules/tower_workflow_job_template.py +++ b/awx_collection/plugins/modules/tower_workflow_job_template.py @@ -107,12 +107,6 @@ options: - absent default: "present" type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" notification_templates_started: description: - list of notifications to send on start 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 2e8b74e843..65603effae 100644 --- a/awx_collection/plugins/modules/tower_workflow_job_template_node.py +++ b/awx_collection/plugins/modules/tower_workflow_job_template_node.py @@ -135,12 +135,6 @@ options: choices: ["present", "absent"] default: "present" type: str - tower_oauthtoken: - description: - - The Tower OAuth token to use. - - If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files - type: str - version_added: "3.7" extends_documentation_fragment: awx.awx.auth ''' diff --git a/awx_collection/plugins/modules/tower_workflow_launch.py b/awx_collection/plugins/modules/tower_workflow_launch.py index 52a6cdd771..3551f211b4 100644 --- a/awx_collection/plugins/modules/tower_workflow_launch.py +++ b/awx_collection/plugins/modules/tower_workflow_launch.py @@ -68,12 +68,6 @@ options: - If waiting for the workflow to complete this will abort after this amount of seconds type: int - 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_workflow_template.py b/awx_collection/plugins/modules/tower_workflow_template.py index 0fa5308c6a..a1accfb453 100644 --- a/awx_collection/plugins/modules/tower_workflow_template.py +++ b/awx_collection/plugins/modules/tower_workflow_template.py @@ -92,7 +92,7 @@ options: requirements: - ansible-tower-cli >= 3.0.2 -extends_documentation_fragment: awx.awx.auth +extends_documentation_fragment: awx.awx.auth_legacy '''