Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Salt Cookbook
  • Toc
  • feedback
Salt Cookbook

Salt Cookbook

By : Anirban Saha
3.5 (2)
close
Salt Cookbook

Salt Cookbook

3.5 (2)
By: Anirban Saha

Overview of this book

If you are a professional associated with system and infrastructure management, looking at automated infrastructure and deployments, then this book is for you. No prior experience of Salt is required.
Table of Contents (13 chapters)
close
12
Index

Using MySQL packages, files, and services


In this recipe, you will learn about how to install the MySQL database. Make sure the proper configuration file for MySQL is present on the host, and the database service is running.

How to do it...

  1. Configure a new minion in the staging environment called salt-minion-mysql. Create a new state directory called mysql in the staging environment.

  2. Create and edit /opt/salt-cookbook/staging/mysql/init.sls to have the following entries:

    mysql_package:
      pkg.installed:
        - name: mysql-server
    
    mysql_conf:
      file.managed:
        - name: /etc/my.cnf
        - source: salt://mysql/files/my.cnf
        - user: root
        - group: root
        - mode: 0644
        - require:
          - pkg: mysql_package
    
    mysql_service:
      service:
        - name: mysqld
        - running
        - enable: True
        - require:
          - file: mysql_conf
        - watch:
          - file: mysql_conf
  3. Create a directory called files in the mysql state directory.

  4. Create and edit /opt/salt-cookbook/staging/mysql/files/my.cnf to have...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete