Book Image

Mastering SaltStack - Second Edition

Book Image

Mastering SaltStack - Second Edition

Overview of this book

SaltStack is a powerful configuration management and automation suite designed to manage servers and tens of thousands of nodes. This book showcases Salt as a very powerful automation framework. We will review the fundamental concepts to get you in the right frame of mind, and then explore Salt in much greater depth. You will explore Salt SSH as a powerful tool and take Salt Cloud to the next level. Next, you’ll master using Salt services with ease in your infrastructure. You will discover methods and strategies to scale your infrastructure properly. You will also learn how to use Salt as a powerful monitoring tool. By the end of this book, you will have learned troubleshooting tips and best practices to make the entire process of using Salt pain-free and easy.
Table of Contents (20 chapters)
Mastering SaltStack Second Edition
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Preface

Incorporating external data sources


We've taken care of Salt keys, but we have some other directories that we need to distribute among the masters. Let's start with a component that is used every time you issue a command from the master to one or more minions: the job cache.

The external job cache

Before we dive into this component, let's review the master job cache:

  1. When a command is issued, a job ID (JID) is created on the master.

  2. Information about that job is stored in the job cache, such as what the command and its arguments are and which minions will be affected.

  3. The job data is posted to the message queue, where the affected minions pick it up and perform the requested work.

  4. When each minion finishes the task, it sends the return data back to the master, where it is also stored in the job cache.

  5. If the salt command is still running, it will pick up the job data and display it to the user.

In this workflow, the minion will always return data to the master, whether or not the salt command is...