Book Image

Mastering SaltStack

By : Joseph Hall
Book Image

Mastering SaltStack

By: Joseph Hall

Overview of this book

Table of Contents (19 chapters)
Mastering SaltStack
About the Author
About the Reviewers


I'm very excited to have been given the chance to put this book together. From an idea in the brain of Tom Hatch to an award-winning open source project to the flagship product of an award-winning open source company, I've been given the rare opportunity to watch Salt grow. Salt has become an incredibly powerful framework, which I wish I had access to years ago.

Everyday, I learn something new about Salt. This book is a collection of a number of these things, which is aimed at the advanced user. Don't see it as the last word on any of the topics it covers. Instead, see it as a guide to using this tool to its fullest potential on your journey.

As you read through this book, I hope that the ideas and examples in it inspire you to update and innovate your infrastructure.

What this book covers

Chapter 1, Reviewing a Few Essentials, talks about how to review a few fundamental concepts to get into the right frame of mind. While many of the concepts should be familiar to the experienced user, you are likely to find plenty of new information as well.

Chapter 2, Diving into Salt Internals, jumps into the deeper workings behind Salt. It discusses the internal configuration, the loader system, renderers, and the state compiler.

Chapter 3, Exploring Salt SSH, explores how Salt SSH is a powerful tool. It's been getting a lot of love from the core developers lately. This is possibly the most complete discussion of Salt SSH.

Chapter 4, Managing Tasks Asynchronously, discusses how one of the most important concepts behind Salt is asynchronicity. This chapter lays down the fundamentals that will be referenced throughout the rest of the book.

Chapter 5, Taking Salt Cloud to the Next Level, goes deeper, exposing parts of Salt Cloud, which turn casual users into experts. No matter how much you've used Salt Cloud, there's a good chance you've only scratched the surface.

Chapter 6, Using Salt with REST, talks about how it's almost impossible to work with technology these days without depending on REST services. It uses Salt to tie these services to your infrastructure with ease.

Chapter 7, Understanding the RAET Protocol, teaches you the concepts behind RAET and how they impact upon you. RAET is still new, but it's already found its way into large organizations.

Chapter 8, Strategies for Scaling, talks about how to never assume that your infrastructure will stay small. It makes you think about how to scale your infrastructure properly before it's too late.

Chapter 9, Monitoring with Salt, discovers how Salt is a powerful monitoring tool if you know how to use it. It tells you how to integrate it with existing tools or use Salt alone.

Chapter 10, Exploring Best Practices, discusses the good and bad ways to use any tool. It teaches you the good ways to use Salt.

Chapter 11, Troubleshooting Problems, tells you where to look and how to find help when things go wrong.

What you need for this book

To follow the examples in this book, you should be running at least version 2015.5 of Salt. Only one machine is strictly necessary because both the salt-master and the salt-minion service can be run together, but Linux is currently required to run the salt-master service.

The examples in this book are targeted at Ubuntu Linux, except where stated otherwise.

Who this book is for

This book is ideal for professionals who have been managing groups of servers and want to learn how to add functionality and expand their toolset. This book explains some of the more advanced features of Salt. It explores how to use them to bring additional power to the fundamentals that the professionals have already been using.


In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "This function does little more than the command."

A block of code is set as follows:

  webdev: 'I@role:web,G@cluster:dev'
  webqa: 'I@role:web,G@cluster:qa'
  webprod: 'I@role:web,G@cluster:prod'

Any command-line input or output is written as follows:

# salt -S

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click the Join This Group link and you will be subscribed".


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to and enter the name of the book in the search field. The required information will appear under the Errata section.


Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.


If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.