Book Image

Learning SaltStack - Second Edition

By : Colton Myers
Book Image

Learning SaltStack - Second Edition

By: Colton Myers

Overview of this book

SaltStack is one of the best infrastructure management platforms available. It provides powerful tools for defining and enforcing the state of your infrastructure in a clear, concise way. With this book learn how to use these tools for your own infrastructure by understanding the core pieces of Salt. In this book we will take you from the initial installation of Salt, through running their first commands, and then talk about extending Salt for individual use cases. From there you will explore the state system inside of Salt, learning to define the desired state of our infrastructure in such a way that Salt can enforce that state with a single command. Finally, you will learn about some of the additional tools that salt provides, including salt-cloud, the reactor, and the event system. We?ll finish by exploring how to get involved with salt and what'?s new in the salt community. Finally, by the end of the book, you'll be able to build a reliable, scalable, secure, high-performance infrastructure and fully utilize the power of cloud computing.
Table of Contents (17 chapters)
Learning SaltStack Second Edition
About the Author
About the Reviewer

Chapter 3. Execution Modules – Write Your Own Solution

In Chapter 2, Controlling Your Minions with Remote Execution, we went over remote execution commands in detail, learning how to target our commands and get things done using Salt's remote execution modules.

In this chapter, we will expand on Salt's remote execution system by diving into the code. You will learn the following things:

  • What an execution module is made up of (and inspect some of the execution modules that ship with Salt)

  • How to write our own execution module functions

  • The extra tools that are easily available to us in the context of execution modules

  • How to sync our execution modules to our minions

Note that in this chapter, we will be inspecting and writing a good deal of Python code. We will not be reviewing basic Python syntax, so if you're unfamiliar with Python, I recommend that you run through the tutorial at or check out one of the many Python books available from Packt Publishing...