Return data to a postgresql server
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 'returns'
--
DROP TABLE IF EXISTS returns;
CREATE TABLE returns (
fun text NOT NULL,
jid varchar(20) NOT NULL,
return text NOT NULL,
id text NOT NULL,
success boolean
);
CREATE INDEX ON returns (id);
CREATE INDEX ON returns (jid);
CREATE INDEX ON returns (fun);
DROP TABLE IF EXISTS highstate;
-- CREATE TABLE highstate (
-- jid bigint PRIMARY KEY,
-- resource text NOT NULL,
-- return hstore
-- );
CREATE INDEX return_idx_gist
ON highstate
USING gist
(return);
EOF
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