In this recipe, you will learn how to create and remove databases in MySQL. You will also learn how to interrelate these definitions with other Salt definitions, and make all the database components work together.
We will use the same minion as the previous recipe.
/opt/salt-cookbook/staging/mysql/database.slsto have the following entries:
include: - mysql MySQL-python: pkg.installed stg_databases: mysql_database.present: - name: stagingdb - require: - pkg: MySQL-python - service: mysql_service databases_to_remove: mysql_database.absent: - name: test - require: - pkg: MySQL-python - service: mysql_service
[root@salt-master ~]# salt 'salt-minion-mysql' ...