ansible / ansible.builtin / v2.7.9 / lookup / onepassword fetch field values from 1Password | "added in version" 2.6 of ansible.builtin" Authors: Scott Buchanan <sbuchanan@ri.pn>, Andrew Zenk <azenk@umn.edu>, Sam Doran<sdoran@redhat.com> preview | supported by communityansible.builtin.onepassword (v2.7.9) — lookup
pip
Install with pip install ansible==2.7.9
onepassword wraps the C(op) command line utility to fetch specific field values from 1Password
- name: Retrieve password for KITT debug: var: lookup('onepassword', 'KITT')
- name: Retrieve password for Wintermute debug: var: lookup('onepassword', 'Tessier-Ashpool', section='Wintermute')
- name: Retrieve username for HAL debug: var: lookup('onepassword', 'HAL 9000', field='username', vault='Discovery')
- name: Retrieve password for HAL when not signed in to 1Password debug: var: lookup('onepassword', 'HAL 9000', subdomain='Discovery', vault_password='DmbslfLvasjdl')
field: default: password description: field to return from each matching item (case-insensitive) vault: default: None description: vault containing the item to retrieve (case-insensitive); if absent will search all vaults _terms: description: identifier(s) (UUID, name, or subdomain; case-insensitive) of item(s) to retrieve required: true section: default: None description: item section containing the field to retrieve (case-insensitive); if absent will return first match from any section subdomain: default: None description: The 1Password subdomain to authenticate against. version_added: '2.7' version_added_collection: ansible.builtin vault_password: default: None description: The password used to unlock the specified vault. version_added: '2.7' version_added_collection: ansible.builtin
_raw: description: field data requested