ansible/ansible — pull request #6825 by gregbuehler (2014-04-02 19:17:11+00:00)
Title: Add ability to import and dump databases using the Postgresql_db module

Tested using the following playbook and an existing database dump:

- hosts: dbserver
tasks:
- name: transfer schema
copy: src=/foo/bar.sql
dest=~/import.sql

- name: test import
postgresql_db: name=test1
login_user=dbuser
login_password=dbuser
state=import
target='~/import.sql'

- name: test dump
postgresql_db: name=test1
login_user=thetus
login_password=thetus
state=dump
target='~/dump.sql'

- name: test reimport
postgresql_db: name=test2
login_user=dbuser
login_password=dbuser
state=import
target='~/dump.sql'