community.general.bitwarden (6.6.8) — lookup

Retrieve secrets from Bitwarden

| "added in version" 5.4.0 of community.general"

Authors: Jonathan Lung (@lungj) <lungj@heresjono.com>

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 6.6.8

Description

Retrieve secrets from Bitwarden.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Get 'password' from Bitwarden record named 'a_test'"
  ansible.builtin.debug:
    msg: >-
      {{ lookup('community.general.bitwarden', 'a_test', field='password') }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Get 'password' from Bitwarden record with id 'bafba515-af11-47e6-abe3-af1200cd18b2'"
  ansible.builtin.debug:
    msg: >-
      {{ lookup('community.general.bitwarden', 'bafba515-af11-47e6-abe3-af1200cd18b2', search='id', field='password') }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Get 'password' from Bitwarden record named 'a_test' from collection"
  ansible.builtin.debug:
    msg: >-
      {{ lookup('community.general.bitwarden', 'a_test', field='password', collection_id='bafba515-af11-47e6-abe3-af1200cd18b2') }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Get full Bitwarden record named 'a_test'"
  ansible.builtin.debug:
    msg: >-
      {{ lookup('community.general.bitwarden', 'a_test') }}
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: "Get custom field 'api_key' from Bitwarden record named 'a_test'"
  ansible.builtin.debug:
    msg: >-
      {{ lookup('community.general.bitwarden', 'a_test', field='api_key') }}

Inputs

    
field:
    description: Field to fetch. Leave unset to fetch whole response.
    type: str

_terms:
    description: Key(s) to fetch values for from login info.
    elements: str
    required: true
    type: list

search:
    default: name
    description: Field to retrieve, for example C(name) or C(id).
    type: str
    version_added: 5.7.0
    version_added_collection: community.general

collection_id:
    description: Collection ID to filter results by collection. Leave unset to skip filtering.
    type: str
    version_added: 6.3.0
    version_added_collection: community.general

Outputs

_raw:
  description: List of requested field or JSON object of list of matches.
  elements: raw
  type: list