Note
This plugin is part of the awx.awx collection (version 19.4.0).
You might already have this collection installed if you are using the ansible
package. It is not included in ansible-core
. To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install awx.awx
.
To use it in a playbook, specify: awx.awx.token
.
New in version 2.3.0: of awx.awx
Parameter | Choices/Defaults | Comments |
---|---|---|
application string | The application tied to this token. | |
controller_config_file path | Path to the controller config file. If provided, the other locations for config files will not be considered. aliases: tower_config_file | |
controller_host string | URL to your Automation Platform Controller instance. If value not set, will try environment variable CONTROLLER_HOST and then config filesIf value not specified by any means, the value of 127.0.0.1 will be usedaliases: tower_host | |
controller_oauthtoken raw added in 3.7.0 of awx.awx | The OAuth token to use. This value can be in one of two formats. A string which is the token itself. (i.e. bqV5txm97wqJqtkxlMkhQz0pKhRMMX) A dictionary structure as returned by the token module. If value not set, will try environment variable CONTROLLER_OAUTH_TOKEN and then config filesaliases: tower_oauthtoken | |
controller_password string | Password for your controller instance. If value not set, will try environment variable CONTROLLER_PASSWORD and then config filesaliases: tower_password | |
controller_username string | Username for your controller instance. If value not set, will try environment variable CONTROLLER_USERNAME and then config filesaliases: tower_username | |
description string | Default: "" | Optional description of this access token. |
existing_token dictionary | The data structure produced from token in create mode to be used with state absent. | |
existing_token_id string | A token ID (number) which can be used to delete an arbitrary token with state absent. | |
scope string |
| Allowed scopes, further restricts user's permissions. Must be a simple space-separated string with allowed scopes ['read', 'write']. |
state string |
| Desired state of the resource. |
validate_certs boolean |
| Whether to allow insecure connections to AWX. If 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 CONTROLLER_VERIFY_SSL and then config filesaliases: tower_verify_ssl |
Note
- block: - name: Create a new token using an existing token token: description: '{{ token_description }}' scope: "write" state: present controller_oauthtoken: "{{ my_existing_token }}" - name: Delete this token token: existing_token: "{{ token }}" state: absent - name: Create a new token using username/password token: description: '{{ token_description }}' scope: "write" state: present controller_username: "{{ my_username }}" controller_password: "{{ my_password }}" - name: Use our new token to make another call job_list: controller_oauthtoken: "{{ token }}" always: - name: Delete our Token with the token we created token: existing_token: "{{ token }}" state: absent when: token is defined - name: Delete a token by its id token: existing_token_id: 4 state: absent
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
controller_token dictionary | on successful create | An Ansible Fact variable representing a token object which can be used for auth in subsequent modules. See examples for usage. | |
id string | success | The numeric ID of the token created | |
token string | success | The token that was generated. This token can never be accessed again, make sure this value is noted before it is lost. |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/awx/awx/token_module.html