$darkmode
Elektra 0.11.0
Plugin: ansible

Provides a write-only storage plugin for use with kdb export and kdb record-export. The output format is an Ansible playbook that utilized the ansible-libelektra module.

Keys that possess the metakey meta:/elektra/removed will be removed using the remove option in ansible-libelektra.

Plugin Configuration

You can use the following configuration keys to modify the behavior and output of the plugin:

Key Default Value Description
playbook 1 Whether to generate a whole playbook or just a (list of) task(s) (0)
playbook/name My Elektra Playbook The name property of the playbook
playbook/hosts all The hosts property of the playbook
task/main/name Set Elektra Keys The name of the 'main' task of the playbook

Dependencies

This plugin requires yaml-cpp. On a Debian based OS the package for the library is called `libyaml-cpp-dev`. On macOS you can install the package `yaml-cpp` via HomeBrew.

Examples

1 # Backup-and-Restore: user:/tests
2 
3 kdb set user:/tests/company/roles/ceo Hans
4 #> Create a new key user:/tests/company/roles/ceo with string "Hans"
5 
6 kdb export user:/tests/company ansible -c playbook/name="Company Roles",task/main/name="I can customize this too"
7 # RET:0
1 ---
2 - name: Company Roles
3  hosts: all
4  collections:
5  - elektra_initiative.libelektra
6  tasks:
7  - name: I can customize this too
8  elektra:
9  keys:
10  - user:
11  tests:
12  company:
13  roles:
14  ceo:
15  - value: Hans

Limitations