mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 18:51:06 -03:30
Merge pull request #6629 from AlanCoding/one_token_to_rule_them_all
Document and align the env var for OAuth token Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -15,20 +15,25 @@ options:
|
|||||||
tower_host:
|
tower_host:
|
||||||
description:
|
description:
|
||||||
- URL to your Tower or AWX instance.
|
- 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
|
type: str
|
||||||
tower_username:
|
tower_username:
|
||||||
description:
|
description:
|
||||||
- Username for your Tower or AWX instance.
|
- Username for your Tower or AWX instance.
|
||||||
|
- If value not set, will try environment variable C(TOWER_USERNAME) and then config files
|
||||||
type: str
|
type: str
|
||||||
tower_password:
|
tower_password:
|
||||||
description:
|
description:
|
||||||
- Password for your Tower or AWX instance.
|
- Password for your Tower or AWX instance.
|
||||||
|
- If value not set, will try environment variable C(TOWER_PASSWORD) and then config files
|
||||||
type: str
|
type: str
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description:
|
description:
|
||||||
- Whether to allow insecure connections to Tower or AWX.
|
- Whether to allow insecure connections to Tower or AWX.
|
||||||
- If C(no), SSL certificates will not be validated.
|
- If C(no), SSL certificates will not be validated.
|
||||||
- This should only be used on personally controlled sites using self-signed certificates.
|
- 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
|
type: bool
|
||||||
aliases: [ tower_verify_ssl ]
|
aliases: [ tower_verify_ssl ]
|
||||||
tower_config_file:
|
tower_config_file:
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
required: False
|
required: False
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
required: False
|
required: False
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -213,6 +213,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- 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"
|
version_added: "3.7"
|
||||||
type: str
|
type: str
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
requirements:
|
requirements:
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ options:
|
|||||||
tower_oauthtoken:
|
tower_oauthtoken:
|
||||||
description:
|
description:
|
||||||
- The Tower OAuth token to use.
|
- The Tower OAuth token to use.
|
||||||
|
- If value not set, will try environment variable C(TOWER_OAUTH_TOKEN) and then config files
|
||||||
type: str
|
type: str
|
||||||
version_added: "3.7"
|
version_added: "3.7"
|
||||||
extends_documentation_fragment: awx.awx.auth
|
extends_documentation_fragment: awx.awx.auth
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ value:
|
|||||||
|
|
||||||
.. code:: bash
|
.. code:: bash
|
||||||
|
|
||||||
export TOWER_TOKEN=6E5SXhld7AMOhpRveZsLJQsfs9VS8U
|
export TOWER_OAUTH_TOKEN=6E5SXhld7AMOhpRveZsLJQsfs9VS8U
|
||||||
|
|
||||||
By ingesting this token, you can run subsequent CLI commands without having to
|
By ingesting this token, you can run subsequent CLI commands without having to
|
||||||
specify your username and password each time:
|
specify your username and password each time:
|
||||||
|
|||||||
@@ -89,5 +89,5 @@ A few of the most important ones are:
|
|||||||
``--conf.password, TOWER_PASSWORD``
|
``--conf.password, TOWER_PASSWORD``
|
||||||
the AWX password to use for authentication
|
the AWX password to use for authentication
|
||||||
|
|
||||||
``--conf.token, TOWER_TOKEN``
|
``--conf.token, TOWER_OAUTH_TOKEN``
|
||||||
an OAuth2.0 token to use for authentication
|
an OAuth2.0 token to use for authentication
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ def add_authentication_arguments(parser, env):
|
|||||||
)
|
)
|
||||||
auth.add_argument(
|
auth.add_argument(
|
||||||
'--conf.token',
|
'--conf.token',
|
||||||
default=env.get('TOWER_TOKEN', ''),
|
default=env.get('TOWER_OAUTH_TOKEN', env.get('TOWER_TOKEN', '')),
|
||||||
help='an OAuth2.0 token (get one by using `awx login`)',
|
help='an OAuth2.0 token (get one by using `awx login`)',
|
||||||
metavar='TEXT',
|
metavar='TEXT',
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class Login(CustomCommand):
|
|||||||
else:
|
else:
|
||||||
fmt = client.get_config('format')
|
fmt = client.get_config('format')
|
||||||
if fmt == 'human':
|
if fmt == 'human':
|
||||||
print('export TOWER_TOKEN={}'.format(token))
|
print('export TOWER_OAUTH_TOKEN={}'.format(token))
|
||||||
else:
|
else:
|
||||||
print(to_str(FORMATTERS[fmt]({'token': token}, '.')).strip())
|
print(to_str(FORMATTERS[fmt]({'token': token}, '.')).strip())
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user