Questions tagged [saltstack]

The Salt Project, previously known as SaltStack, is a Python-based open-source configuration management software and remote execution engine.

Salt is an open source tool to manage your infrastructure. Easy enough to get running in minutes and fast enough to manage tens of thousands of servers and still get a response back in seconds.

Execute arbitrary shell commands or choose from dozens of pre-built modules of common (or complex) commands. Target individual servers or groups of servers based on name, defined roles, or a variety of system information such as hardware, software, operating system, current version, current environment, and many more.

Bring your servers up to a known configured state by writing simple lists of items and defining attributes on those lists.

Links

See also the salt-stack tag on Stack Overflow.

286 questions
86
votes
6 answers

How do I list all connected Salt Stack minions?

Sometimes my saltmaster hangs for a while on salt '*' test.ping waiting for downed minions to reply. Is there a way so see a list of connected minions, regardless of whether they respond to test.ping?
Petrus Theron
  • 1,611
  • 5
  • 17
  • 24
17
votes
4 answers

SaltStack: Call a single state of a sls file

I fail to call a single state of an sls file. Whole sls file works This works: salt-ssh w123 state.sls monitoring This works: salt-ssh w123 state.show_sls monitoring One item of above output: monitoring_packages: ---------- __env__: …
guettli
  • 3,833
10
votes
3 answers

SaltStack: Is there a way to only display failed and warnings in output?

Running state.apply or state.highstate on minions can result in hundreds of lines in output. Sometimes only one minion can be enough. ... Summary for my_minion -------------- Succeeded: 112 (changed=78) Failed: 6 Warnings: …
gogan
  • 215
10
votes
2 answers

SaltStack: How one can execute a state only once?

I have to execute a state only once. I couldn't find a simple way to do this. Now, the context I install two MySQL servers through salt. I want to make one a slave of the other. In order to setup the slave, I need to get the master status…
7
votes
1 answer

Salt: Minion did not return but salt-call is working

I am working with SaltStack on Windows minions (Linux master). I have written a simple .sls file which copies a hello-world.txt at C:/hello_world.txt. I have also written my top.sls and configure my file_roots. Minions keys have been accepted (and…
MarAja
  • 203
7
votes
1 answer

How do I check output of salt command that runs in background?

I've got a salt script written by someone else that is executing a bunch of commands. It runs for a very long time. My connection to the machine that runs it broke, but it is still running. How do I get back to it to see what it does? I did not…
simbabque
  • 207
5
votes
2 answers

How to copy file from master to minions on salt-stack?

I want to copy a file from salt stack master server to minion servers. I found a script from https://stackoverflow.com/questions/27687886/copy-a-file-from-salt-master-to-minions. But I got an error. copy_my_files: file.recurse: - source:…
Janith
  • 223
5
votes
2 answers

How to use saltstack to manage different config file for different minions?

I have two minions with httpd server managed under saltstack. VirtualHost based on ports need to be configured for them separately. So /etc/httpd/conf.d/httpd-vhost.conf is watched like this: httpd: pkg.installed: [] service.running: -…
seanlook
  • 579
5
votes
1 answer

How to create salt from pillar using saltstack?

Lets take an example of what I have today: https://gist.github.com/Natim/6548009 I use the pillar to create a database and a user. It works fine on server with one of the roles but if I need both roles on the same server only the last pillar is…
Natim
  • 636
  • 1
  • 6
  • 16
5
votes
2 answers

How do you execute a cmd.script once the pre-requisite files have been downloaded?

I have a very simple use case that I'm trying to get going: I need to download and install a few tar.gz source packages from the master and then run a script to compile and install all of them. I realize this is probably a basic question, but any…
Carl
  • 211
4
votes
1 answer

Moving Salt Master to a new server

So I am tasked with migrating some servers into AWS. One of the servers is a Salt Master. Upon investigation, all Salt Minions connect to the Master using DNS name instead of IP Address, so from connectivity standpoint I only need to change the A…
pepoluan
  • 5,138
4
votes
1 answer

Apply states on minions after they come online

Imagine you want to apply some states on a group of minions, such as all ubuntu clients. It's possible by the time we apply that states some of the minions are offline. How long do states remain in the message bus to be pushed on minions? What…
AKJ88
  • 153
4
votes
1 answer

SaltStack: schedule highstate in batch

I would like to schedule a highstate to run every night but not in parallel. Is there a way to add batch option to the scheduling system? Example: schedule: highstate: enabled: True function: state.highstate maxrunning: 1 when:…
HTF
  • 3,198
4
votes
1 answer

Salt-Stack copy directory from salt master to minion

Background: I have been working on setting up a salt-environment, and reached the point where I want to distribute not only files, but also directories. I've found that the most sensible way to do this is to place the directory I want copied in…
simonra
  • 143
4
votes
1 answer

Delay execution of command until after something else has run

I am trying to write a deploy script with salt. It mostly works. I have to run highstate a couple of times for it work all the way. My biggest issue is working through how to execute commands one after another based on specific first one, and them…
Buddy Lindsey
  • 269
  • 3
  • 9
1
2 3 4 5 6 7 8