Once the groups and users are set up in the PostgreSQL database, it is then time to configure some databases and extensions. In this recipe, we will learn how to configure databases and extensions, and relate them with the groups and users we have already configured.
We will use the same minion as the previous recipe.
Create and edit
/opt/salt-cookbook/staging/postgresql/database.sls
to have the following entries:include: - postgresql.users postgres_staging_db: postgres_database.present: - name: stagingdb - owner: stgdb - require: - postgres_user: postgres_db_user
Edit
/opt/salt-cookbook/staging/top.sls
to have the following entries:staging: '*': - postgresql.database
Apply the state to the minion, using the following command:
[root@salt-master ~]# salt 'salt-minion-postgresql' state.highstate saltenv=staging salt-minion-postgresql: ---------- . . . . ---------- ID: postgres_staging_db Function: postgres_database...