Return data to a postgresql server
maintainer: | None |
---|---|
maturity: | New |
depends: | psycopg2 |
platform: | all |
To enable this returner the minion will need the psycopg2 installed and the following values configured in the minion or master config:
returner.postgres.host: 'salt'
returner.postgres.user: 'salt'
returner.postgres.passwd: 'salt'
returner.postgres.db: 'salt'
returner.postgres.port: 5432
Running the following commands as the postgres user should create the database correctly:
psql << EOF
CREATE ROLE salt WITH PASSWORD 'salt';
CREATE DATABASE salt WITH OWNER salt;
EOF
psql -h localhost -U salt << EOF
--
-- Table structure for table 'jids'
--
DROP TABLE IF EXISTS jids;
CREATE TABLE jids (
jid bigint PRIMARY KEY,
load text NOT NULL
);
--
-- Table structure for table 'salt_returns'
--
DROP TABLE IF EXISTS salt_returns;
CREATE TABLE salt_returns (
fun text NOT NULL,
jid varchar(20) NOT NULL,
return text NOT NULL,
id text NOT NULL,
success boolean
);
CREATE INDEX ON salt_returns (id);
CREATE INDEX ON salt_returns (jid);
CREATE INDEX ON salt_returns (fun);
Required python modules: psycopg2
Return a dict of the last function called for all minions
Return the information returned when the specified job id was executed
Return a list of all job ids
Return the load data that marks a specified jid
Return a list of minions
Return data to a postgres server
Save the load to the specified jid id