ANSIBLE.POSTGRESQL_DB(3)

NAME
postgresql_db - Add or remove PostgreSQL databases from a remote host.

DESCRIPTION

Add or remove PostgreSQL databases from a remote host.

OPTIONS

encoding
    Encoding of the database

lc_collate
    Collation order (LC_COLLATE) to use in the database. Must match collation order of template database unless template0 is used as template.

lc_ctype
    Character classification (LC_CTYPE) to use in the database (e.g. lower, upper, ...) Must match LC_CTYPE of template database unless template0 is used as template.

login_host
    Host running the database (default: localhost)

login_password
    The password used to authenticate with

login_user
    The username used to authenticate with

name
    name of the database to add or remove(required)

owner
    Name of the role to set as owner of the database

state
    The database state Choices: present,absent. (default: present)

template
    Template used to create the database."

NOTES

The default authentication assumes that you are either logging in as or sudo'ing to the postgres account on the host.

This module uses psycopg2, a Python PostgreSQL database adapter. You must ensure that psycopg2 is installed on the host before using this module. If the remote host is the PostgreSQL server (which is the default case), then PostgreSQL must also be installed on the remote host. For Ubuntu-based systems, install the postgresql, libpq-dev, and python-psycopg2 packages on the remote host before using this module.
# Create a new database with name "acme"
- postgresql_db: name=acme
# Create a new database with name "acme" and specific encoding and locale
# settings. If a template different from "template0" is specified, encoding
# and locale settings must match those of the template.
- postgresql_db: name=acme
                 encoding='UTF-8'
                 lc_collate='de_DE.UTF-8'
                 lc_ctype='de_DE.UTF-8'
                 template='template0'

AUTHOR
Lorin Hochstein

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#postgresql-db