ansible-infra/roles/postgresql
2025-02-15 20:06:55 +01:00
..
defaults add postgresql role for ens. psql and opt. some dbs and users are set up 2025-02-15 06:23:04 +01:00
meta add postgresql role for ens. psql and opt. some dbs and users are set up 2025-02-15 06:23:04 +01:00
tasks for non-verbose output hide user passwords in postgresql role 2025-02-15 20:06:55 +01:00
README.md add postgresql role for ens. psql and opt. some dbs and users are set up 2025-02-15 06:23:04 +01:00

Role postgresql

Ensures postgresql is installed by installing the distributions package.
Also ensures the optionally given databases and users are set up as specified.

Supported Distributions

Should work on Debian-based distributions.

Required Arguments

None.

Optional Arguments

  • postgresql__dbs: List of databases with their owner to ensure are set up.
  • postgresql__dbs.*.name: Name of the database.
  • postgresql__dbs.*.owner: Owner of the database.
  • postgresql__users: List of users to ensure are set up.
  • postgresql__users.*.name: Name of the user.
  • postgresql__users.*.password: Optional password for the user. If left unset, the user will have no password set, but can still connect using peer authentication on the local system. (Peer authentication works when a password is set as well.)

Example Arguments

postgresql__dbs:
  - name: netbox
    owner: netbox
  - name: foo
    owner: bar
postgresql__users:
  - name: netbox
    password: super_secret
  - name: bar