Salt Bundle is a package manager for Salt formulas, similar to pip, npm, or Helm. It allows you to version, publish, and install Salt formulas with dependency management and reproducible builds.
- Publishing Guide - How to create and publish formulas
- Formula Configuration -
.saltbundle.yamlformat for formulas - Repository Setup - Setting up your own repository
- Installation Guide - Installing and using formulas
- Project Configuration -
.saltbundle.yamlformat for projects - Version Constraints - Semantic versioning and dependency resolution
- CLI Reference - Complete command-line interface documentation
- File Formats - All configuration file formats
- CI/CD Integration - GitHub Actions and GitLab CI examples
Salt Bundle provides:
- Version Management - Use semantic versioning for Salt formulas
- Dependency Resolution - Declare and automatically resolve formula dependencies
- Package Distribution - Publish formulas to HTTP or local repositories
- Reproducible Builds - Lock files ensure consistent deployments
- Automatic Integration - Salt loader plugin auto-discovers formulas (no config changes needed)
- Manual Integration - Also works with existing Salt setups via
file_roots
- Formula - A Salt state directory with
.slsfiles and metadata - Package - A versioned
.tgzarchive of a formula - Repository - HTTP/file location containing packages and an index
- Project - Your infrastructure code that depends on formulas
- Vendor Directory - Local folder where dependencies are installed
- Salt Loader Plugin - Automatic integration with Salt without config changes
# Initialize formula metadata
cd my-formula
salt-bundle formula init
# Edit .saltbundle.yaml with your metadata
# Pack the formula
salt-bundle formula pack
# Creates: my-formula-1.0.0.tgz
# Generate repository index
mkdir -p /srv/salt-repo
cp my-formula-1.0.0.tgz /srv/salt-repo/
cd /srv/salt-repo
salt-bundle repo index
# Creates: index.yaml# Initialize project
mkdir my-project
cd my-project
salt-bundle project init
# Add repository (global config)
salt-bundle repo add --name main --url https://example.com/salt-repo/
# Edit .salt-dependencies.yaml to add dependencies
# dependencies:
# my-formula: "^1.0.0"
# Install dependencies
salt-bundle project install
# Installs to: vendor/my-formula/
# Use in Salt
salt-call --local \
--file-root=/path/to/my-project/salt:/path/to/my-project/vendor \
state.applypip install salt-bundlegit clone https://github.com/SomeBlackMagic/salt-bundle.git
cd salt-bundle
pip install -e .salt-bundle --help- Create a formula with Salt states
- Add
.saltbundle.yamlmetadata - Pack into versioned archive
- Publish to repository
- Update repository index
See Publishing Guide for details.
- Initialize project with
.saltbundle.yaml - Add repositories
- Declare dependencies with version constraints
- Install dependencies (creates lock file)
- Integrate with Salt via
file_roots
See Installation Guide for details.
Publishers Repository Consumers
────────── ────────── ─────────
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Formula │ │ index.yaml │ │ .saltbundle│
│ Directory │──pack─────▶ │ │ │ .yaml │
│ │ │ formula- │ │ │
│ - init.sls │ │ 1.0.0.tgz │◀────fetch────│ dependencies│
│ - .saltbundle │ │ │ │
│ .yaml │ │ formula- │ └─────────────┘
└─────────────┘ │ 1.0.1.tgz │ │
└─────────────┘ install
│
▼
┌─────────────┐
│ vendor/ │
│ formula/ │
│ - init.sls │
└─────────────┘
- Full semver support:
1.2.3,1.2.3-beta.1 - Version constraints:
^1.0.0,~1.2.3,>=1.0,<2.0 - Automatic resolution to latest compatible version
- Declare dependencies in
.saltbundle.yaml - Automatic resolution across repositories
- Lock file for reproducible installations
- Repository-specific dependencies:
repo/package
- HTTP/HTTPS repositories
- Local file:// repositories
- Multiple repository support
- Package caching
- Automated release workflows
- GitHub Releases support
- GitHub Pages for index hosting
- GitLab CI compatible
name: my-formula
version: 1.0.0
description: My Salt formula
maintainers:
- name: Developer Name
email: dev@example.com
salt:
min_version: "3006"
max_version: "3009"
dependencies:
- name: common
version: "^1.0"project: my-infrastructure
version: 0.1.0
vendor_dir: vendor
repositories:
- name: main
url: https://salt-formulas.example.com/
dependencies:
nginx: "^2.0.0"
mysql: "~5.7"
main/redis: ">=6.0,<7.0"dependencies:
nginx:
version: 2.1.0
repository: main
url: https://salt-formulas.example.com/nginx-2.1.0.tgz
digest: sha256:abc123...formulas/
├── nginx/
│ ├── .saltbundle.yaml
│ └── init.sls
├── mysql/
│ ├── .saltbundle.yaml
│ └── init.sls
└── redis/
├── .saltbundle.yaml
└── init.sls
# Release all formulas
cd formulas
salt-bundle repo release --formulas-dir . --provider local --pkg-storage-dir ../repo# In formula repository
salt-bundle repo release --formulas-dir . --single --provider github
# With GitHub:
export GITHUB_TOKEN=ghp_xxx
export GITHUB_REPOSITORY=owner/repo
salt-bundle repo release --formulas-dir . --single --provider github# Add private repository
salt-bundle repo add --name private --url https://private.example.com/repo/
# Use in project
dependencies:
private/internal-formula: "^1.0.0"After pip install salt-bundle, Salt automatically discovers formulas in your project's vendor/ directory.
No configuration changes needed!
# Install salt-bundle
pip install salt-bundle
# Navigate to project with .saltbundle.yaml
cd my-project
# Run Salt commands - formulas auto-discovered from vendor/
salt-call state.apply nginx
salt-ssh '*' state.apply mysql
# Verify loader is working
salt-call pillar.get saltbundleHow it works:
- Salt automatically loads the plugin via entry points
- Plugin searches for
.saltbundle.yamlin current directory - Reads
vendor_dirfrom config - Automatically adds formulas to
file_roots
See examples/project/README.md for detailed examples.
#!/usr/bin/env bash
PROJECT_ROOT="$(cd "$(dirname "$0")" && pwd)"
VENDOR_DIR="${PROJECT_ROOT}/vendor"
SALT_DIR="${PROJECT_ROOT}/salt"
salt-call --local \
--file-root="${SALT_DIR}:${VENDOR_DIR}" \
"$@"# /etc/salt/master
file_roots:
base:
- /srv/salt
- /srv/my-project/vendor# /etc/salt/minion
file_roots:
base:
- /srv/salt
- /srv/my-project/vendor- Issues: Report bugs and request features on GitHub Issues
- Documentation: This documentation is in the
docs/directory - Contributing: Pull requests welcome!
[Add your license here]
- Publishers: Read the Publishing Guide
- Consumers: Read the Installation Guide
- CI/CD: Check CI/CD Integration
- Reference: See CLI Reference