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

Adding groups and users

Users and groups constitute some of the fundamental components of any infrastructure, starting from users logging in to systems, to running applications and databases as a particular user. In this recipe, you will learn how to configure users and groups with Salt.

How to do it...

Configure a minion called salt-minion in the staging environment, and create two states called groups and users by creating respective directories for them. In the base pillar directory of the staging environment, create two directories called groups and users.

  1. Create and edit /opt/salt-cookbook/pillar/staging/groups/init.sls to have the following entries:
    app_group:
      group_name: stg-app
      group_id: 2001
  2. Create and edit /opt/salt-cookbook/pillar/staging/users/init.sls ...

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