ansible/lib/ansible
Josh Moore d5ae6cc585 postgres_db: add dump and restore support (#20627)
* Feature #2731: added postgres import and dump

* Feature #2731: be more permissive of arguments

```
hacking/test-module -m ./ppostgresql_db.py -a "db=example state=dump target=/tmp/out"`
```

failed previously since host, user, and port were required as keywords
in the pg_dump / pg_import methods.

* Feature #2731: fixed doc string for validate-modules

```
$ ansible-validate-modules database/postgresql/
```

now passes.

* Feature #2731: disable 'password' for dump/restore

* Feature #2731: bump added version to 2.3

* Feature #2731: replace db_import with db_restore

* Feature #2731: add missing version description

* Feature #2731: fix 'state' description

* Feature #2731: fix pep8 issues

* Feature #2731: put state documentation in a single string

* Bump added version from 2.3 to 2.4

* Fix pep8 and pylint errors

* Attempt yaml formatting of documentation string

* Add integration tests for postgres_db:dump/restore

* Update dump/restore logic to support new kw-args

Also attempt to support password; integration tests are
still failing.

* Revert to postgres user for dump/restore

Passing PGPASSWORD is not working for subprocesses. For the
moment, reverting to the strategy of failing if login_password
is set and using `postgres` for all testing of dump/restore.

* Various cleanups to have tests passing

* Working tests for {sql,tar} x {,bz2,gz,xz}

* Use pg_user to support FreeBSD

* Revert login_ prefixes and re-enable password support

All `login_` keywords are mapped to their non-prefix versions
so the previous changes were effectively using `postgres` for
all actions. With the proper keywords, PGPASSWORD-passing to
the subprocess is now working.

* Optionally add password

environ_update doesn't handle None values in the
dictionary to be added to the environment. Adding
check.

* Quick fixes

* Refactor login arguments after fixes from pchauncey

The fixes introduced by pchaunchy pointed to further issues
(like no --dbname on PG<=9.2) with the login parameters. This
refactors them and adds further tests.

Note: this will still not pass integration tests due to a further
      issue with pg_dump as a non-admin user:

      pg_restore: [archiver (db)] Error while PROCESSING TOC:
      pg_restore: [archiver (db)] Error from TOC entry 1925; 0 0 COMMENT EXTENSION plpgsql
      pg_restore: [archiver (db)] could not execute query: ERROR:  must be owner of extension plpgsql

* Introduce target_opts for passing limiting dumped/restored schemas

The current integration tests (PG version and template DBs) don't
permit a regular user (`{{ db_user1 }}`) access to plpgsql causing
restores to fail. By adding an option for passing arbitrary args to
pg_dump and pg_restore, testing is made easier. This also paves the
way for `-j` usage, once the PG version is bumped.
2017-07-10 08:05:42 +01:00
..
cli metadata and doc generator optimization and fixes 2017-07-04 01:12:43 -07:00
compat
config added some docs to config entries 2017-07-06 20:22:05 -04:00
errors correct, cleanup & simplify dwim stack (#25956) 2017-07-03 15:27:53 -04:00
executor better backwards compat handling of status 2017-07-05 21:44:00 -04:00
galaxy
inventory Ensure hosts aren't duplicated in groups 2017-06-19 17:38:43 -04:00
module_utils cloudstack: add nic operation (#26168) 2017-07-07 13:41:59 +02:00
modules postgres_db: add dump and restore support (#20627) 2017-07-10 08:05:42 +01:00
parsing Adds search in template/files/vars relative to the playbook path (#26460) 2017-07-05 19:45:09 -04:00
playbook add any_errors_fatal global config 2017-07-03 17:05:44 -04:00
plugins script: Add support for chdir argument 2017-07-07 09:40:02 -07:00
template Try to show original exception info for yaml (and other) errors (#24468) 2017-06-09 13:13:15 -04:00
utils Remove metadata from docstring parsing as per last week's meeting decision 2017-07-04 01:12:43 -07:00
vars correct, cleanup & simplify dwim stack (#25956) 2017-07-03 15:27:53 -04:00
__init__.py
constants.py constants: pep8 fix (#25735) 2017-06-15 13:40:06 +02:00
release.py