Salt Masterless Quickstart

Running a masterless salt-minion lets you use salt's configuration management for a single machine. It is also useful for testing out state trees before deploying to a production setup.

The only real difference in using a standalone minion is that instead of issuing commands with salt, we use the salt-call command, like this:

salt-call --local state.highstate

Bootstrap Salt Minion

First we need to install the salt minion. The salt-bootstrap script makes this incredibly easy for any OS with a Bourne shell. You can use it like this:

wget -O - | sudo sh

Or see the salt-bootstrap documentation for other one liners. Additionally, if you are using Vagrant to test out salt, the salty-vagrant tool will provision the VM for you.

Create State Tree

Now we build an example state tree. This is where the configuration is defined. For more in depth directions, see the tutorial.

1. Create the top.sls file

# /srv/salt/top.sls
    - webserver

2. Create our webserver state tree

# /srv/salt/webserver.sls
apache:                 # ID declaration
  pkg:                  # state declaration
    - installed         # function declaration

The only thing left is to provision our minion using the highstate command. Salt-call also gives us an easy way to give us verbose output:

salt-call --local state.highstate -l debug

The --local flag tells the salt-minion to look for the state tree in the local file system. Normally the minion copies the state tree from the master and executes it from there.

That's it, good luck!

当前网页内容, 由 大妈 ZoomQuiet 使用工具: ScrapBook :: Firefox Extension 人工从互联网中收集并分享;
若有不妥, 欢迎评注提醒:


订阅 substack 体验古早写作:

点击注册~> 获得 100$ 体验券: DigitalOcean Referral Badge

关注公众号, 持续获得相关各种嗯哼:


关于 ~ DebugUself with DAMA ;-)
公安备案号: 44049002000656 ...::