community.general.lmdb_kv (2.5.9) — lookup

fetch data from LMDB

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

Authors: Jan-Piet Mens (@jpmens)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 2.5.9

Description

This lookup returns a list of results from an LMDB DB corresponding to a list of items given to it


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: query LMDB for a list of country codes
  ansible.builtin.debug:
    msg: "{{ query('community.general.lmdb_kv', 'nl', 'be', 'lu', db='jp.mdb') }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: use list of values in a loop by key wildcard
  ansible.builtin.debug:
    msg: "Hello from {{ item.0 }} a.k.a. {{ item.1 }}"
  vars:
    - lmdb_kv_db: jp.mdb
  with_community.general.lmdb_kv:
     - "n*"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get an item by key
  ansible.builtin.assert:
    that:
      - item == 'Belgium'
    vars:
      - lmdb_kv_db: jp.mdb
    with_community.general.lmdb_kv:
      - be

Inputs

    
db:
    default: ansible.mdb
    description: path to LMDB database

_terms:
    description: list of keys to query

Outputs

_raw:
  description: value(s) stored in LMDB
  elements: raw
  type: list