Setting up PostgreSQL groups and users

After setting up our PostgreSQL environment, the next important task is to set up the authentication process for users and groups. In this recipe, you will learn how to create groups and users in PostgreSQL database.

How to do it...

We will use the same minion as the previous recipe.

  1. Create and edit /opt/salt-cookbook/staging/postgresql/users.sls to have the following entries:
    postgres_db_grp: postgres_group.present: - name: stggrp - login: True postgres_db_user: postgres_user.present: - name: stgdb - password: {{ pillar['postgresql']['passwd'] }} - encrypted: True - groups: stggrp - require: - postgres_group: postgres_db_grp postgres_admin_user: postgres_user.present: - name: stgadmin - password: {{ pillar['postgresql']['passwd'] ...

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.