You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation.
onepassword - fetch field values from 1Password
- onepassword wraps the
op
command line utility to fetch specific field values from 1Password
The below requirements are needed on the local master node that executes this lookup.
Parameter |
Choices/Defaults |
Configuration |
Comments |
_terms
required |
|
|
identifier(s) (UUID, name or domain; case-insensitive) of item(s) to retrieve
|
field
|
Default:
"password"
|
|
field to return from each matching item (case-insensitive)
|
section
|
Default:
"None"
|
|
item section containing the field to retrieve (case-insensitive); if absent will return first match from any section
|
vault
|
Default:
"None"
|
|
vault containing the item to retrieve (case-insensitive); if absent will search all vaults
|
- name: "retrieve password for KITT"
debug:
msg: "{{ lookup('onepassword', 'KITT') }}"
- name: "retrieve password for Wintermute"
debug:
msg: "{{ lookup('onepassword', 'Tessier-Ashpool', section='Wintermute') }}"
- name: "retrieve username for HAL"
debug:
msg: "{{ lookup('onepassword', 'HAL 9000', field='username', vault='Discovery') }}"
Common return values are documented here, the following are the fields unique to this lookup:
Key |
Returned |
Description |
_raw
|
|
field data requested
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This lookup is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.