Grinder is a dynamic environment deployment tool for SaltStack inspired by the excellent r10k. Using it allows for dynamic, flexible deployments of multiple environments with formulas, states, and pillars.
- Python 3+
- It is recommended to use VirtualEnv to manage your Python environment.
pip install gitpython
pip install pyyaml
You'll need to update the environment configuration to point at your
states repository and your
pillar repository. This is currently located under the project directory in
<repobase>/grinder/conf/grinder/grinder.conf. Modify the environment section to point at your remote repositories.
There are several steps to be taken to prepare your repositories for dynamic deployment.
top.slsfile must be configured as if it is the only one being deployed. It can be completely unique between branches.
- The pillar and state repositories at this time must have the same branches as they will be deployed together. This may be altered in the future. Just remember that when you make a new feature branch in your states repository you're going to have to make a corresponding branch for pillar as well.
- Remove all external formulas from your states repository branches. In each branch place them into a
seasoning.ymlfile located in the base of the states respository. There is an example YAML file specifying the format located in this repository.
- Configure the Salt master configuration file to set
- Modify the Salt Master's
masterconfiguration to point the
pillar_rootssections at the newly created branches in the directory structure (default: /srv/salt/environments/branchname).
- Restart Salt Master.
- To use an alternate dynamic environment on a Minion, use the option