community.general.lmdb_kv (0.1.4) — 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:==0.1.4


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.4

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
  debug:
    msg: "{{ query('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
  debug:
    msg: "Hello from {{ item.0 }} a.k.a. {{ item.1 }}"
  vars:
    - lmdb_kv_db: jp.mdb
  with_lmdb_kv:
     - "n*"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get an item by key
  assert:
    that:
      - item == 'Belgium'
    vars:
      - lmdb_kv_db: jp.mdb
    with_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