onepassword.connect.field_info (2.2.4) — module

Returns the value of a field in a 1Password item.

| "added in version" 2.2.0 of onepassword.connect"

Authors: 1Password (@1Password)

Install collection

Install with ansible-galaxy collection install onepassword.connect:==2.2.4


Add to requirements.yml

  collections:
    - name: onepassword.connect
      version: 2.2.4

Description

Get the value a single field given its label.

You may provide a section label to limit the search to that item section.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Find a field labeled "username" in an item named "MySQL Database" in a specific vault.
  onepassword.connect.field_info:
    item: MySQL Database
    field: username
    vault: 2zbeu4smcibizsuxmyvhdh57b6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Find a field labeled "username" in a specific section.
  onepassword.connect.field_info:
    item: MySQL Database
    section: Credentials
    field: username
    vault: 2zbeu4smcibizsuxmyvhdh57b6

Inputs

    
item:
    description:
    - Name or ID of the item
    required: true
    type: str

field:
    description:
    - The field label to search for.
    - If the section parameter is undefined, the  field label must be unique across all
      item fields.
    required: true
    type: str

token:
    description:
    - The token to authenticate 1Password Connect calls.
    - Ansible should never log or display this value.
    type: str

vault:
    description:
    - ID of the Vault containing the item
    required: true
    type: str

section:
    description:
    - An item section label or ID.
    - If provided, the module limits the search for the field to this section.
    - If not provided, the module searches the entire item for the field.
    type: str

hostname:
    description:
    - URL of 1Password Connect.
    type: str

Outputs

field:
  contains:
    id:
      description: UUID for the returned field
      returned: success
      sample: fb3b40ac85f5435d26e
      type: str
    section:
      description: The section containing this field, if any.
      type: str
    value:
      description: The field's stored value
      returned: success
      type: str
  description: The value and metadata of the field
  returned: always
  type: complex