redhat_cop / redhat_cop.ah_configuration / 0.8.0 / module / ah_token create, update, or destroy Automation Hub tokens. | "added in version" 2.10 of redhat_cop.ah_configuration" Authors: John Westcott IV (@john-westcott-iv), Sean Sullivan (@sean-m-sullivan) preview | supported by communityredhat_cop.ah_configuration.ah_token (0.8.0) — module
Install with ansible-galaxy collection install redhat_cop.ah_configuration:==0.8.0
collections: - name: redhat_cop.ah_configuration version: 0.8.0
Create or destroy Automation Hub tokens. See U(https://www.ansible.com/tower) for an overview.
In addition, the module sets an Ansible fact which can be passed into other ah_* modules as the parameter ah_oauthtoken. See examples for usage.
Because of the sensitive nature of tokens, the created token value is only available once through the Ansible fact. (See RETURN for details)
Due to the nature of tokens in Automation Hub this module is not idempotent. A second will with the same parameters will create a new token.
If you are creating a temporary token for use with modules you should delete the token when you are done with it. See the example for how to do it.
- name: Create a new token using an existing token ah_token: ah_token: "{{ my_existing_token }}"
- name: Delete this token ah_token: ah_token: "{{ ah_token }}" state: absent
- name: Create a new token using username/password ah_token: state: present ah_username: "{{ my_username }}" ah_password: "{{ my_password }}"
- name: Use our new token to make another call namespace: ah_token: "{{ ah_token }}"
state: choices: - present - absent default: present description: - Desired state of the resource. type: str ah_host: aliases: - ah_hostname description: - URL to Ansible Galaxy or Automation Hub instance. - If value not set, will try environment variable C(AH_HOST) - If value not specified by any means, the value of C(127.0.0.1) will be used type: str ah_token: description: - The Ansible Galaxy or Automation Hub API 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 ah_token module. - If value not set, will try environment variable C(AH_API_TOKEN) type: raw ah_password: description: - Password for your Ansible Galaxy or Automation Hub instance. - If value not set, will try environment variable C(AH_PASSWORD) type: str ah_username: description: - Username for your Ansible Galaxy or Automation Hub instance. - If value not set, will try environment variable C(AH_USERNAME) type: str ah_path_prefix: description: - API path used to access the api. - For galaxy_ng this is either 'automation-hub' or the custom prefix used on install with GALAXY_API_PATH_PREFIX - For Automation Hub this is 'galaxy' type: str validate_certs: aliases: - ah_verify_ssl description: - Whether to allow insecure connections to Galaxy or Automation Hub Server. - 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(AH_VERIFY_SSL) type: bool
ah_token: contains: id: description: The numeric ID of the token created type: str token: description: The token that was generated. This token can never be accessed again, make sure this value is noted before it is lost. type: str description: An Ansible Fact variable representing a Tower token object which can be used for auth in subsequent modules. See examples for usage. returned: on successful create type: dict