postgresql-service

Example:

# Install PostgreSQL database service.
- postgresql-service:
    postgresql_version: '10'
    listen_addresses:
    - '*'
    pg_hba:
    - method: md5
      address: 0.0.0.0/0

Description

This frecklet installs the PostgreSQL service using the ANXS.postgresql Ansible role.

This frecklet does not do any configuration, and uses all the defaults of the underlying Ansible role. Use other tasks to do any configuration after executing this.

Resources

Variables

Name Type Default Description

listen_addresses

list --

The network addresses this instance listens on. Default: localhost.

max_connections

integer --

Max. allowed connections. Default: 100

pg_hba

list --

A list of hosts to allow connections from, apart from the default:

local  all  postgres    trust
# "local" is for Unix domain socket connections only
local  all  all    trust
# IPv4 local connections:
host  all  all  127.0.0.1/32  trust
# IPv6 local connections:
host  all  all  ::1/128  trust
# Local root Unix user, passwordless access
local  all  postgres    peer map=root_as_postgres

port

integer --

The port this postgresql service listens on. Default: 5432.

postgresql_group_id

integer --

An (optional) custom PostgreSQL group id.

postgresql_user_id

integer --

An (optional) custom PostgreSQL user id.

postgresql_version

string --

The version of postgresql.

superuser_reserved_connections

integer --

Superuser reserved connections. Default: 3

Examples

Example 1

Install PostgreSQL database service.

Code
- postgresql-service:
    postgresql_version: '10'
    listen_addresses:
    - '*'
    pg_hba:
    - method: md5
      address: 0.0.0.0/0
Description

This installs the PostgreSQL database service, version 10, listening on all network interfaces, and allowing authenticated md5-connections from everywhere ('0.0.0.0/0').

Command-line

frecklecute postgresql-service --help

Usage: frecklecute postgresql-service [OPTIONS]

  This frecklet installs the PostgreSQL service using the
  [ANXS.postgresql](https://gitlab.com/frkl-downstream/ANXS.postgresql)
  Ansible role.

  This frecklet does not do any configuration, and uses all the defaults of
  the underlying Ansible role. Use other tasks to do any configuration after
  executing this.

Options:
  --listen-address IP             The network addresses this instance listens
                                  on. Default: localhost.
  --max-connections MAX_CONNECTIONS
                                  Max. allowed connections. Default: 100
  --port PORT                     The port this postgresql service listens on.
                                  Default: 5432.
  --postgresql-group-id POSTGRESQL_GROUP_ID
                                  An (optional) custom PostgreSQL group id.
  --postgresql-user-id POSTGRESQL_USER_ID
                                  An (optional) custom PostgreSQL user id.
  --postgresql-version POSTGRESQL_VERSION
                                  The version of postgresql.
  --superuser-reserved-connections SUPERUSER_RESERVED_CONNECTIONS
                                  Superuser reserved connections. Default: 3
  --help                          Show this message and exit.