.. _postgresql_db: postgresql_db `````````````````````````````` .. versionadded:: 0.6 Add or remove PostgreSQL databases from a remote host. .. raw:: html
parameter required default choices comments
state no present
  • present
  • absent
The database state
name yes
    name of the database to add or remove
    login_password no
      The password used to authenticate with
      owner no
        Name of the role to set as owner of the database
        login_user no
          The username used to authenticate with
          login_host no localhost
            Host running the database
            .. raw:: html

            Create a new database with name 'acme'

                postgresql_db db=acme
                


            .. raw:: html

            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.