salt.pillar.sqlite3 module

Retrieve Pillar data by doing a SQLite3 query

New in version 2015.8.0.

sqlite3 is included in the stdlib since Python 2.5.

This module is a concrete implementation of the sql_base ext_pillar for SQLite3.


Configuring the sqlite3 ext_pillar

Use the 'sqlite3' key under ext_pillar for configuration of queries.

SQLite3 database connection configuration requires the following values configured in the master config:

Note, timeout is in seconds.

sqlite3.database: /var/lib/salt/pillar.db
sqlite3.timeout: 5.0

Complete Example

  database: '/var/lib/salt/pillar.db'
  timeout: 5.0

  - sqlite3:
        query: 'SELECT col1,col2,col3,col4,col5,col6,col7
                  FROM some_random_table
                 WHERE minion_pattern LIKE ?'
        depth: 5
        as_list: True
        with_lists: [1,3]
class salt.pillar.sqlite3.SQLite3ExtPillar

This class receives and processes the database rows from SQLite3.

salt.pillar.sqlite3.ext_pillar(minion_id, pillar, *args, **kwargs)

Execute queries against SQLite3, merge and return as a dict