O'Reilly logo

Learning SaltStack - Second Edition by Colton Myers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Defining the State of Your Infrastructure

In the previous chapter, we finished our deep dive of the remote execution system inside Salt. Remote execution is the foundation upon which all of the rest of Salt rests. In this chapter, you will learn about one of the most important systems: "the state system." You will learn the following:

  • How states are structured and how to write our first state
  • About the various pieces of the state declaration
  • How to expand our state declarations to encompass multiple pieces of a state
  • About ordering states with requisites

Our first state

Without further ado, let's write our first state. All Salt-specific files that aren't Python files end in the extension .sls. By default, the states are located in the /srv/salt/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required