The SLS efficiency
When building an SLS tree, the directory structure is only part of the equation. There are a number of strategies that can be employed in the SLS files, which will increase their ease of use and maintainability.
Includes and extends
Like a number of modern languages and file formats, SLS files were designed to take advantage of code reuse. Rather than creating large, monolithic files, states can be broken down into smaller files, which can be combined together across multiple environments.
Consider the following partial SLS file:
iptables: service: - dead httpd: pkg: - installed service: - running /opt/codebase: file.recurse: - source: salt://codebase/files
Obviously, a production version of this would be far longer, but this short version fits our needs.
There are three distinct components of this SLS: the firewall, the web server, and the code base. There is an implied order here: the web server can't serve pages if the firewall is...