purestorage.flasharray.purefa_token module – Create or delete an API token for an existing admin user
Note
This module is part of the purestorage.flasharray collection (version 1.39.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 purestorage.flasharray.
To use it in a playbook, specify: purestorage.flasharray.purefa_token.
New in purestorage.flasharray 1.0.0
Synopsis
- Create or delete an API token for an existing admin user. 
- Uses username/password to create/delete the API token. 
Parameters
| Parameter | Comments | 
|---|---|
| Disable insecure certificate warnings in debug logs Choices: 
 | |
| FlashArray management IPv4 address or Hostname. | |
| Password of the admin user to create API token for. | |
| Recreates the API token, overwriting the existing API token if present Choices: 
 | |
| Create or delete API token Choices: 
 | |
| The duration of API token validity. Valid values are weeks (w), days(d), hours(h), minutes(m) and seconds(s). | |
| Username of the admin user to create API token for | 
Examples
- name: Create API token with no expiration
  purefa_token:
    username: pureuser
    password: secret
    state: present
    fa_url: 10.10.10.2
- name: Create API token with 23 days expiration
  purefa_token:
    username: pureuser
    password: secret
    state: present
    timeout: 23d
    fa_url: 10.10.10.2
- name: Delete API token
  purefa_token:
    username: pureuser
    password: secret
    state: absent
    fa_url: 10.10.10.2
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Description | 
|---|---|
| API token for user Returned: changed Sample:  | 
