Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

Table of Contents (18 chapters)
Salt Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Orchestration with Salt orchestrate


Orchestration, as we know, is an extremely important feature that should be available in any configuration management system. In Salt, this objective has been achieved till date by overstate. However, a new runner, called orchestrate, has been introduced in Salt to achieve the same objective in a much more efficient manner, and it replaces overstate. In this recipe, you will learn about how to use the orchestrate runner.

How to do it...

  1. Configure two minions, stgdc1web01 and stgdc1dbs01. Configure the server_type grain in stgdc1web01 with the value web and in stgdc1dbs01 as db.

  2. Create two new states called nginx and mysql by creating directories for both in the base directory of the staging environment.

  3. Create the /opt/salt-cookbook/staging/nginx/init.sls file and edit it to have the following entries:

    nginx_package:
      pkg.installed:
        - name: nginx
    
    nginx_service:
      service:
        - name: nginx
        - running
        - enable: True
        - require:
          - pkg: nginx_package...