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
11
votes
1 answer

Setting Up Environments with SaltStack

How do I make minions use a particular SaltStack environment? The GitFS backend tutorial states that branches will be mapped to environments using the branch name as identifier. How do I expose these environments to my minions? As an example, let's…
Kyle Kelley
  • 13,804
  • 8
  • 49
  • 78
10
votes
1 answer

SaltStack state to install .deb package file and dependencies

I have a salt formula. On server I am using wkhtmltopdf tools. Ubuntu repo has this tool but it has an older version. I want to use the latest version. I am doing the following to get it installed on minions manually. $ wget…
bitkot
  • 4,466
  • 2
  • 28
  • 39
10
votes
2 answers

Using file.managed for downloading a file in Salt

salt.states.file.managed takes source_hash as an argument to verify a downloaded file. This blocks me from using file.managed for a file on an online server I don't have control over. The file also changes regularly. My configuration looks like…
cdMinix
  • 655
  • 1
  • 7
  • 29
10
votes
2 answers

Saltstack: ignoring result of cmd.run

I am trying to invoke a command on provisioning via Saltstack. If command fails then I get state failing and I don't want that (retcode of command doesn't matter). Currently I have the following workaround: Run something: cmd.run: - name:…
mizmu
  • 111
  • 1
  • 6
10
votes
1 answer

How to avoid repeating myself in Salt states?

We have two different environments, dev and production, managed by a single Salt server. Something like this: base: 'dev-*': - users-dev 'prod-*': - users-prod user-dev and users-prod states are pretty much the same, like this: {% for…
Alex
  • 907
  • 2
  • 8
  • 22
9
votes
1 answer

What's the difference between state.sls and state.apply?

What's the difference between state.apply and state.sls? When should I use state.apply vs state.sls?
aedry
  • 336
  • 4
  • 14
9
votes
2 answers

The repository is not signed to install a package on Ubuntu

I'm using Salt (SaltStack) to install packages in Ubuntu 18.04. I want to install a formula for docker, for example. When I apply docker state, I get an error that a package can't be installed, because the package repository that is used in a…
Vitali Plagov
  • 722
  • 1
  • 12
  • 31
9
votes
5 answers

Compare version numbers using jinja2

I am using jinja2 template to install/upgrade packages. The logic was setting a variable for current installed version and compare it with the available version. It was working fine but once we passed in to 10.x, comparison quit working. Is it…
BBDG
  • 365
  • 4
  • 11
9
votes
2 answers

Is there a way to log a debug message in saltstack out of an .sls or a .jinja file?

Is there a way to log a custom debug message in saltstack out of an .sls or a .jinja file? i.e. something like: {% salt.log_message("Entering...") %}
Ya.
  • 1,671
  • 4
  • 27
  • 53
9
votes
1 answer

Salt: Can I use an argument from the command line as a jinja variable?

Given a file called package-list, I want to do something like: salt state.sls install-packages list_to_install=package-list ...and then in the sls: packages: pkg.installed: - names: {% include list_to_install %}
jMyles
  • 11,772
  • 6
  • 42
  • 56
8
votes
2 answers

SaltStack: getting No top file or master_tops data matches found

I am new to SaltStack and following some tutorials and trying to execute state.apply but getting below error: # salt "host2" state.apply host2: ---------- ID: states Function: no.None Result: False Comment: No Top file or…
Dhiman S.
  • 101
  • 1
  • 1
  • 5
8
votes
3 answers

How to seamlessly rename a minion?

I am considering to move to salt (currently using ansible) to manage a set of standalone IoT devices (Raspberry Pi in practical terms). The devices would be installed with a generic image, to which I would add on top the installation of salt (client…
WoJ
  • 27,165
  • 48
  • 180
  • 345
8
votes
3 answers

Generating documentation for salt stack states

I have a repository with salt states for provisioning my cluster of servers in the cloud. Over time, I kept on adding more states - the .sls files - into this repo. Now im starting to struggle what is what and what is where. I am wondering if there…
dopstar
  • 1,478
  • 10
  • 20
8
votes
2 answers

Configuring Salt API - Java

I'm attempting to use Salt-Api, so I created a salt-api.conf in /etc/salt/master.d/ as follows: external_auth: pam: saltuser: - .* - '@wheel' # to allow access to all wheel modules - '@runner' # to allow access to all…
cybertextron
  • 10,547
  • 28
  • 104
  • 208
8
votes
1 answer

Salt minion inside docker container?

Do you run a salt minion inside a docker containers? Or do you only run a minion on the server which runs the docker containers? We don't use salt at the moment, but want to use it in the future. We are unsure how to layout our infrastructure in the…
guettli
  • 25,042
  • 81
  • 346
  • 663
1 2
3
96 97