lmdb_kv – fetch data from LMDB

Synopsis

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

Requirements

The below requirements are needed on the local master node that executes this lookup.

Parameters

Parameter Choices/Defaults Configuration Comments
_terms
-
list of keys to query
db
-
Default:
"ansible.mdb"
path to LMDB database

Examples

- name: query LMDB for a list of country codes
  debug:
    msg: "{{ query('lmdb_kv', 'nl', 'be', 'lu', db='jp.mdb') }}"

- 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*"

- name: get an item by key
  assert:
    that:
      - item == 'Belgium'
    vars:
      - lmdb_kv_db: jp.mdb
    with_lmdb_kv:
      - be

Return Values

Common return values are documented here, the following are the fields unique to this lookup:

Key Returned Description
_raw
-
value(s) stored in LMDB



Status

Authors

  • Jan-Piet Mens (@jpmens)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.