Postgresql_exec module

Hi Ansible devs,

I’m attempting to make this module 2.x compatible in the hope I can get it added to core because it would nicely add to the postgresql_ set of modules

https://github.com/jirutka/ansible-modules/blob/master/action_plugins/postgresql_exec.py

https://github.com/jirutka/ansible-modules/blob/master/library/database/postgresql_exec.py

It’s a action_plugin pair that templates / selects a file then hands of the pycog work to a module.

As and example of a 2.x module that does the same I’m looking to:-

lib/ansible/plugins/action/template.py

So I’m going to have a try at adjusting it to use the 2.x api today.

My other option is to take one of the postgresql_ modules and may be just create a postgresql_psql version that can execute sql passed as a parameter to learn how they work, then try and add the action module templating afterwards.

Any advice / help appreciated.

I’ve managed to get the key features working so I’m just going to clean it all up and then start work on the module itself to bring that inline with the other Postgres modules.

https://github.com/gilesw/ansible-modules/

Okay mostly done now with tests running in travis ci. I’ve moved it all to a new repo as the original author doesn’t want to be involved:-

https://github.com/gilesw/ansible-postgresql_exec

Key test I need to make is character encoding and escaping as I’ve removed some of the code from his original code.