#SaltStack
High-speed remote execution and configuration management.
#Overview
| Component | Description |
|---|---|
| Salt Master | Central server |
| Minions | Managed nodes |
| States | Configuration definitions |
| Pillars | Secure variables |
#State Example
yaml
1# /srv/salt/webserver.sls
2nginx:
3 pkg.installed: []
4 service.running:
5 - enable: True
6 - require:
7 - pkg: nginx
8
9/etc/nginx/nginx.conf:
10 file.managed:
11 - source: salt://nginx/nginx.conf
12 - require:
13 - pkg: nginx
14 - watch_in:
15 - service: nginx#Commands
bash
1# Test connectivity
2salt '*' test.ping
3
4# Apply state
5salt '*' state.apply webserver
6
7# Remote execution
8salt '*' cmd.run 'uptime'
9
10# Grain (system info)
11salt '*' grains.items#Strengths
- Very fast execution
- ZeroMQ-based transport
- Event-driven architecture
- Strong remote execution
[!TIP] Pro Tip: Salt is excellent for real-time infrastructure management!