Documentation

postgresql_ext - Add or remove PostgreSQL extensions from a database.

New in version 1.9.

Synopsis

Add or remove PostgreSQL extensions from a database.

Requirements (on host that executes module)

  • psycopg2

Options

parameter required default choices comments
db
yes
    name of the database to add or remove the extension to/from
    login_host
    no localhost
      Host running the database
      login_password
      no
        The password used to authenticate with
        login_user
        no
          The username used to authenticate with
          name
          yes
            name of the extension to add or remove
            port
            no 5432
              Database port to connect to.
              state
              no present
              • present
              • absent
              The database extension state

              Examples

              # Adds postgis to the database "acme"
              - postgresql_ext: name=postgis db=acme
              

              Notes

              Note

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

              Note

              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.

              This is an Extras Module

              For more information on what this means please read Extras Modules

              For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.