---
name: postgresql

templates:
  postgresql_ctl.erb: bin/postgresql_ctl
  postgresql.conf.erb: config/postgresql.conf
  pg_hba.conf.erb: config/pg_hba.conf

packages:
  - pid_utils
  - postgresql_9.3

provides:
- name: db
  type: postgresql
  properties:
  - bind_port
  - databases

properties:
  bind_ip:
    description: |
      IP address on which the PostgresSQL server will listen.
    default: 0.0.0.0

  bind_port:
    description: |
      Port on which the PostgresSQL server will listen.
    default: 5432

  databases:
    description: |
      List of databases to create, along with a role name and password of a role
      to create for the database.
    example:
    - name: my-database
      role: my-db-role
      password: my-db-password
    - name: my-other-database
      role: my-other-db-role
      password: my-other-db-password

  max_connections:
    description: |
      Maximum number of open database connections to support.
    default: 500
