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 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: ...