I need to run a query on a postgresql database in a module I'm writing for Salt. It won't do much, just query a table for a value to determine what version of the software is installed.
The docs have a psql_query
function but you can't specify the database, so I'm guessing the query is run against the maintenance db.
To confound things, the postgresql module docs say I have to specify connection params in the minion config, which means having to manually create the postgresql user or duplicating configuration unless the minion config can read from pillar data (pretty sure it can't).
Now, the mysql module for salt does have the exact interface I need in the query
function.
The inability to query a psql db seems like such an egregious oversight that its probably me misunderstanding something. Ordinarily I would dive into the code and figure out what is going, but there is so much magic I don't know where to begin. Any help?