salt.pillar.sqlite3 module

Retrieve Pillar data by doing a SQLite3 query

sqlite3 is included in the stdlib since python2.5.

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

maturity:new
platform:all

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.

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

Complete example

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

ext_pillar:
  - sqlite3:
      fromdb:
        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