O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring PostgreSQL databases

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.

How to do it...

We will use the same minion as the previous recipe.

  1. 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
  2. Edit /opt/salt-cookbook/staging/top.sls to have the following entries:
    staging:
      '*':
        - postgresql.database
  3. Apply the state to the minion, using ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required