Setting up users and giving them proper permissions to access databases is one of the most critical tasks in database management. In this recipe, you will learn how to create database users and manage their access from different servers.
We will use the same minion as the previous recipe.
/opt/salt-cookbook/pillar/staging/mysql/init.slsto have the following entries:
mysql: stg-passwd-hash: '*CAC560C0ED394C2D89B7A1F08422B200B2FFBC26'
/opt/salt-cookbook/pillar/staging/top.slsto have the following entries:
staging: '*': - mysql
/opt/salt-cookbook/staging/mysql/users.slsto have the following entries:
include: - mysql.database db_user: mysql_user.present: - name: stg-db ...