onepassword.connect.item_info (2.2.4) — module

Returns information about a 1Password Item

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

The name or ID of an item can be given.

It is possible to return information about a specific field instead of an item.

If no vaults are specified, the module searches every vault accessible by the API token.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
---
- name: Find and return Item details for "Dev-Database" in vault with ID "2zbeu4smcibizsuxmyvhdh57b6"
  onepassword.connect.item_info:
    item: Dev-Database
    vault: 2zbeu4smcibizsuxmyvhdh57b6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Find and return Item details for Item with ID "lixyh6993asdfq9njdzf221d3z" in vault with ID "2zbeu4smcibizsuxmyvhdh57b6"
  onepassword.connect.item_info:
    item: lixyh6993asdfq9njdzf221d3z
    vault: 2zbeu4smcibizsuxmyvhdh57b6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Find and return Item details for Item with ID "lixyh6993asdfq9njdzf221d3z" without specifying the vault
  onepassword.connect.item_info:
    item: lixyh6993asdfq9njdzf221d3z
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Return 'key' field for Item "Dev-Database" in vault with ID "2zbeu4smcibizsuxmyvhdh57b6"
  onepassword.connect.item_info:
    item: Dev-Database
    field: key
    vault: 2zbeu4smcibizsuxmyvhdh57b6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Return 'secretKey' field for Item with ID 'lixyh6993asdfq9njdzf221d3z' in vault with ID "2zbeu4smcibizsuxmyvhdh57b6"
  onepassword.connect.item_info:
    item: lixyh6993asdfq9njdzf221d3z
    field: secretKey
    vault: 2zbeu4smcibizsuxmyvhdh57b6
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Return 'ccNumber' field for Item 'Business Visa' in Vault 'Office Expenses'
  onepassword.connect.item_info:
    item: Business Visa
    field: ccNumber
    vault: Office Expenses
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get all fields for an item, formatted as a list
  onepassword.connect.item_info:
    item: Business Visa
    vault: Office Expenses
    flatten_fields_by_label: false

Inputs

    
item:
    description:
    - Name or ID of the item as shown in the 1Password UI.
    required: true
    type: str

field:
    description:
    - Name of specific field for the Item
    type: str

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

vault:
    description:
    - Name or ID of the Vault in which the Item is stored.
    - If not specified, the module searches through every vault accessible by the API
      token.
    type: str

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

flatten_fields_by_label:
    default: true
    description:
    - Toggles whether the module returns an item's fields as a dictionary of fields keyed
      by the field label.
    - If false, the item fields are returned as a list.
    - B(WARNING) When set to C(true), non-unique field labels may overwrite each other.
      Consider using C(onepassword.connect.field_info) instead or setting this option
      to C(false).
    - Beginning in C(3.0.0) this setting will default to C(false)
    type: bool

Outputs

field:
  contains:
    field_type:
      description: Type identifier for the field
      returned: success
      sample: concealed
      type: str
    label:
      description: User-provided name for a field
      returned: success
      type: str
    section:
      description: The section name or identifier that the field is under
      type: str
    value:
      description: Value stored under this field
      returned: success
      type: str
  description: Value of the field for the Item.
  returned: when field option is defined
  type: complex
op_item:
  contains:
    category:
      description: The Item template used when creating or modifying the item
      returned: success
      sample: LOGIN
      type: str
    created_at:
      description: Timestamp that reports when the Item was originally created
      returned: success
      sample: '2020-11-23T15:29:07.312397-08:00'
      type: str
    fields:
      description:
      - Collection of all fields for the Item. The key for each field is the field's
        label.
      - If C(flatten_fields_by_label) is C(true), this value will be a list.
      returned: success
      type: dict
    id:
      description: Unique ID for the Item.
      returned: success
      sample: bactwEXAMPLEpxhpjxymh7yy
      type: str
    tags:
      description: All unique tag values associated with the item
      elements: str
      returned: success
      sample:
      - tag1
      - tag2
      type: list
    title:
      description: User-provided name for the Item. Displayed in 1Password clients.
      returned: success
      sample: My Test Item
      type: str
    updated_at:
      description: Timestamp that reports when the Item was last modified.
      returned: success
      sample: '2020-11-23T15:29:07.312397-08:00'
      type: str
    vault:
      description: Information about the Vault containing this Item.
      returned: success
      sample:
      - id: abc1234EXAMPLEvault5678
      type: dict
  description: Dictionary containing Item properties. See 1Password API specs for
    complete structure.
  returned: when field option is not set
  type: complex