Questions tagged [salt-stack]

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 saltstack tag on Server Fault.

1444 questions
5
votes
1 answer

Saltstack master can't find execution module, says not available

I have written a simple module and have put the file under /_modules, the content is more or less: # foomod.py def foo(*args): return {'name': 'foo', 'result': True} I've run salt minion saltutil.sync_all, have seen the output…
Eren Güven
  • 2,314
  • 19
  • 27
5
votes
1 answer

Salt-Stack does watch imply require

We have the following salt state, does the watch imply a require? Or is the rule best written this way? "celery-worker:": supervisord.running: - update: True - watch: - file: /etc/supervisor/conf.d/celery-worker.conf - pkg:…
koblas
  • 25,410
  • 6
  • 39
  • 49
5
votes
2 answers

Using ssh agent forwarding with salt states

So I have the following in my vagrant file: config.ssh.forward_agent = true And the following salt state: git+ssh://git@bitbucket.org/xxx/repo.git: git.latest: - rev: rest - target: /home/vagrant/src However I get a public-key error when…
Michael
  • 2,258
  • 1
  • 23
  • 31
5
votes
1 answer

Salt's mine.get command works on CLI but not in a jinja template

I'm using SaltStack, and have pillar files for minions that match on grains. When I run a mine.get command on a minions CLI, it works fine: salt-call mine.get 'role:production-server' network.ip_addrs grain Returns a list of hosts and their…
elsmorian
  • 51
  • 1
  • 2
5
votes
1 answer

What order do states in top.sls get executed?

My top.sls looks like this: base: '*': - python - memcache - nbviewer - supervisor - firewall I'm on SaltStack 0.17 and the python state doesn't get executed first. This results in later states failing. Within the states…
Kyle Kelley
  • 13,804
  • 8
  • 49
  • 78
5
votes
2 answers

How can I aggregate SaltStack command results?

Is it possible to run a SaltStack command that, say, looks to see if a process is running on a machine, and aggregate the results of running that command on multiple minions? Essentially, I'd like to see all the results that are returned from the…
Bryan
  • 2,205
  • 1
  • 23
  • 43
4
votes
0 answers

Salt state to create virtualenv for python-3.8 on ubuntu 20

The following repo-install.sls used to work on ubuntu 16, python 3.5 repo-install-dependencies: pkg.installed: - names: - python3-pip - python3-venv - mercurial - git -…
kundan
  • 1,278
  • 14
  • 27
4
votes
1 answer

Salt State Rendering: Can I See the Output of the Jinja Phase?

Question: Is there any way to see the output of the Jinja phase, before attempting to parse as YAML? Background: I was trying to debug a Salt problem where I was getting this error: local: Data failed to compile: ---------- Rendering SLS ':test.sls'…
Michael Iles
  • 4,687
  • 2
  • 20
  • 17
4
votes
2 answers

How to use salt to test out jinja functionality?

I am looking for a way to test if salt would render a jinja template the way I expect it to. If I have a file template.sls containing: {% for usr in ['moe','larry','curly'] %} {{ usr }}: user.present {% endfor %} Can I run a salt command that…
halbeik
  • 43
  • 1
  • 4
4
votes
1 answer

How to make saltstack retrieve states from multiple branches in gitfs

I have several computers managed by the Saltstack that are used both for production and development. These PCs are our internal servers and purpose of using Saltstack is (1) to backup settings for quickly reapplying them in case of failures (2)…
wl2776
  • 4,099
  • 4
  • 35
  • 77
4
votes
2 answers

Multiple file.line in single state in Salt

I would like to have a Salt state for managing my SSH file. This requires multiple file.line operations. How can I do this? UPDATE: See bottom of the question for my current workaround What I have is this: Secure SSH: file: - name:…
Martijn de Milliano
  • 3,908
  • 3
  • 36
  • 45
4
votes
3 answers

saltstack: run parallel / wait for other jobs

I have multiple salt states and commands which are executed while other jobs could currently running. Then I get an error for new jobs, something like: The function "state.apply" is running as PID 3869 and was started at 2017, Mar 23…
imehl
  • 789
  • 1
  • 9
  • 25
4
votes
0 answers

SaltStack master/minion to administrate my database that is inside a container

I have been learning Docker for a while and been trying to migrate some of the SaltStack states that I have made for previously provisioning all my systems to partly (?) using docker. However once I have my database within a container how can I…
Matthew Usurp
  • 743
  • 5
  • 13
4
votes
1 answer

Saltstack retrieve IP address using mine.get

Am trying to create a template where it will retrieve the IP address of consul servers as DNS using mine.get. On command line it seems to work fine, but when used in the template context its not returning anything Here is my setup In /srv/pillar I…
Mo J. Mughrabi
  • 6,747
  • 16
  • 85
  • 143
4
votes
4 answers

What are "states" when using SaltStack?

I'm trying SaltStack after using Puppet for a while, but I can't understand their use of the word "state". My understanding is that, for example, a light switch has 2 possible states - on or off. When I write my SLS configuration I am describing…
NoChecksum
  • 1,206
  • 1
  • 14
  • 31