Initial commit

This commit is contained in:
Ansible Core Team 2020-03-09 09:11:07 +00:00
commit aebc1b03fd
4861 changed files with 812621 additions and 0 deletions

View file

@ -0,0 +1,4 @@
shippable/posix/group2
destructive
skip/aix
skip/python2.6 # lookups are controller only, and we no longer support Python 2.6 on the controller

View file

@ -0,0 +1,10 @@
---
- hosts: localhost
tasks:
- name: Install LMDB Python package
pip:
name: lmdb
- name: Setup test data
script: test_db.py
args:
executable: "{{ ansible_python.executable }}"

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
set -eux
ANSIBLE_ROLES_PATH=../ \
ansible-playbook dependencies.yml -v "$@"
ANSIBLE_ROLES_PATH=../ \
ansible-playbook test.yml -v "$@"

View file

@ -0,0 +1,26 @@
- hosts: localhost
tasks:
- debug:
msg: '{{ query(''lmdb_kv'', ''nl'', ''be'', ''lu'', db=''jp.mdb'') }}'
- debug:
var: item.1
loop: '{{ query(''community.general.lmdb_kv'', db=''jp.mdb'') }}'
- assert:
that:
- query('lmdb_kv', 'nl', 'be', 'lu', db='jp.mdb') == ['Netherlands', 'Belgium', 'Luxembourg']
- query('lmdb_kv', db='jp.mdb')|length == 5
- assert:
that:
- item.0 == 'nl'
- item.1 == 'Netherlands'
vars:
- lmdb_kv_db: jp.mdb
with_community.general.lmdb_kv:
- n*
- assert:
that:
- item == 'Belgium'
vars:
- lmdb_kv_db: jp.mdb
with_community.general.lmdb_kv:
- be

View file

@ -0,0 +1,11 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import lmdb
map_size = 1024 * 100
env = lmdb.open('./jp.mdb', map_size=map_size)
with env.begin(write=True) as txn:
txn.put('fr'.encode(), 'France'.encode())
txn.put('nl'.encode(), 'Netherlands'.encode())
txn.put('es'.encode(), 'Spain'.encode())
txn.put('be'.encode(), 'Belgium'.encode())
txn.put('lu'.encode(), 'Luxembourg'.encode())