mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 12:10:06 -03:30
Document and align the env var for OAuth token
This commit is contained in:
@@ -22,7 +22,7 @@ value:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
export TOWER_TOKEN=6E5SXhld7AMOhpRveZsLJQsfs9VS8U
|
||||
export TOWER_OAUTH_TOKEN=6E5SXhld7AMOhpRveZsLJQsfs9VS8U
|
||||
|
||||
By ingesting this token, you can run subsequent CLI commands without having to
|
||||
specify your username and password each time:
|
||||
|
||||
@@ -89,5 +89,5 @@ A few of the most important ones are:
|
||||
``--conf.password, TOWER_PASSWORD``
|
||||
the AWX password to use for authentication
|
||||
|
||||
``--conf.token, TOWER_TOKEN``
|
||||
``--conf.token, TOWER_OAUTH_TOKEN``
|
||||
an OAuth2.0 token to use for authentication
|
||||
|
||||
@@ -16,7 +16,7 @@ def add_authentication_arguments(parser, env):
|
||||
)
|
||||
auth.add_argument(
|
||||
'--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`)',
|
||||
metavar='TEXT',
|
||||
)
|
||||
|
||||
@@ -102,7 +102,7 @@ class Login(CustomCommand):
|
||||
else:
|
||||
fmt = client.get_config('format')
|
||||
if fmt == 'human':
|
||||
print('export TOWER_TOKEN={}'.format(token))
|
||||
print('export TOWER_OAUTH_TOKEN={}'.format(token))
|
||||
else:
|
||||
print(to_str(FORMATTERS[fmt]({'token': token}, '.')).strip())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user