community.general.onepassword (0.1.4) — lookup

fetch field values from 1Password

Authors: Scott Buchanan (@scottsb), Andrew Zenk (@azenk), Sam Doran (@samdoran)

Install collection

Install with ansible-galaxy collection install community.general:==0.1.4


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.4

Description

C(onepassword) wraps the C(op) command line utility to fetch specific field values from 1Password.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# These examples only work when already signed in to 1Password
- name: Retrieve password for KITT when already signed in to 1Password
  debug:
    var: lookup('onepassword', 'KITT')
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve password for Wintermute when already signed in to 1Password
  debug:
    var: lookup('onepassword', 'Tessier-Ashpool', section='Wintermute')
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve username for HAL when already signed in to 1Password
  debug:
    var: lookup('onepassword', 'HAL 9000', field='username', vault='Discovery')
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve password for HAL when not signed in to 1Password
  debug:
    var: lookup('onepassword'
                'HAL 9000'
                subdomain='Discovery'
                master_password=vault_master_password)
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Retrieve password for HAL when never signed in to 1Password
  debug:
    var: lookup('onepassword'
                'HAL 9000'
                subdomain='Discovery'
                master_password=vault_master_password
                username='tweety@acme.com'
                secret_key=vault_secret_key)

Inputs

    
field:
    default: password
    description: field to return from each matching item (case-insensitive).

vault:
    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:
    description: Item section containing the field to retrieve (case-insensitive). If
      absent will return first match from any section.

username:
    description: The username used to sign in.

subdomain:
    description: The 1Password subdomain to authenticate against.

secret_key:
    description: The secret key used when performing an initial sign in.

master_password:
    aliases:
    - vault_password
    description: The password used to unlock the specified vault.

Outputs

_raw:
  description: field data requested