O'Reilly logo

Learning SaltStack 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

Dependencies using requisites

These states will run in the order they are defined in the file by default. However, we can also affect the ordering using requisites. Requisites allow us to create dependencies and interactions between our states.

The require requisite

The most basic requisite is require, which allows you to specify that one state requires another state to be run successfully first. Make sure you note both purposes—the require requisite both ensures correct ordering, and ensures that the requiring states runs only if the required state ran successfully.

In this case, we want to make sure that apache is installed before we try to run it. Thus, we will add a require requisite declaration under our service.running state, as shown here: ...

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