Introducing the Top File
The Top file is used to apply multiple state files to your Salt minions during a highstate. The states that are applied to each system are determined by the targets that are specified in the Top file.
Understanding the Top File
Before we create a Top file, it might be useful to take a moment to think about what what your system configurations look like. Consider the different types of systems you set up, and what is common and unique about each. Each system can receive multiple configurations, so start with the most general configurations and work your way down to the specifics.
For example, you might start with a simple description similar to the following:
In the SaltStack paradigm, the list itself would be the Top file, and each item on the list would be a state. Targets are used within the Top file to define which states are applied to each Salt minion.
The following example shows how our configurations might be translated to YAML and represented in a Top file:
When the Top file is evaluated, Salt minions execute all states that are defined for any target that they match. For example, a system with a Salt minion ID of
atl-web4-prod would apply the vim, scripts, users, apache, python, and django states.