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

How to I retrieve the home directory of a user

let's say I have a service that has a pillar-configured user associated with it now I want to fetch a tar.gz and put it in this user home directory... how do I do that... user.info return a bunch of data including the home directory.. but how do I…
nthiebaud
  • 214
  • 2
  • 6
7
votes
1 answer

How does Python's types.FunctionType create dynamic Functions?

I'm trying to strengthen my Python skills, and I came across Open-Source code for Saltstack that is using types.FunctionType, and I don't understand what's going on. salt.cloud.clouds.cloudstack.py Function create() has the following bit of…
Bernard2324
  • 125
  • 1
  • 9
7
votes
1 answer

SaltStack modules vs states

When searching for a functionality of SaltStack, often a state and a module turn up (when searching for "saltstack user" for example, one gets salt.states.user and salt.modules.user). Reading the documentation, I get the impression that states…
Kai Hatje
  • 431
  • 6
  • 17
7
votes
3 answers

Regex matching in jinja2 filters (for use in saltstack)

It seems Jinja2 (as supported in Saltstack) doesn't support regex matching, unless I'm missing something? A number of frameworks that leverage Jinja2, such as Ansible have custom support for regex filters. Elsewhere people are directed to write…
sxc731
  • 2,418
  • 2
  • 28
  • 30
7
votes
1 answer

Salt: manage 100+ virtualenvs on one host

How can we structure the salt state tree to be able to run highstate for one virtualenv out of a large number running on a host? We run virtualenvs for development and in production, using fabric. We want to switch from fabric to salt. Everything…
guettli
  • 25,042
  • 81
  • 346
  • 663
7
votes
1 answer

SaltStack: Properties (computed values) for data from SLS files?

We run several Python virtual environments on our minions managed by salt. The name of the system is build by this schema: project_customer_stage Example: supercms_favoritcustomer_p The pillar data: systems: - customer: favoritcustomer …
guettli
  • 25,042
  • 81
  • 346
  • 663
7
votes
1 answer

How do i add the contents of a pillar variable to a file with salt?

In a salt state file, how do I add the contents of a pillar to a file on the remote salt-minion? For instance, if I have pillar data like: ssl: some-domain.com: key: -----BEGIN RSA PRIVATE KEY----- MIICX... snip…
Kevin
  • 1,489
  • 2
  • 20
  • 30
7
votes
2 answers

(SaltStack) ID dog in SLS dog is not a dictionary

I have been trying to find a pattern (bcm2708_wdog) in the /etc/modules file and if it isnt there add it to the bottom. Every time I try this I get the "ID dog in SLS dog is not a dictionary". I have no idea what this means. Here is the…
ad450
  • 73
  • 1
  • 5
7
votes
1 answer

How to run state.highstate for a particular environment?

My environments structure in /etc/salt/master looks like this file_roots: base: - /srv/salt dev: - /srv/salt/dev stg: - /srv/salt/stg prod: - /srv/salt/prod And my top.sls file is in /srv/salt dev: 'ip-10-1-1-28': -…
Suraj HK
  • 289
  • 2
  • 10
  • 20
7
votes
2 answers

How can I make multiple replacements on the same file using one saltstack state?

Here's my target file: Sonatype Nexus # ============== # This is the most basic configuration of Nexus. # Jetty section application-port=8081 application-host=0.0.0.0 nexus-webapp=${bundleBasedir}/nexus nexus-webapp-context-path=/nexus # Nexus…
Nathan Basanese
  • 8,475
  • 10
  • 37
  • 66
7
votes
4 answers

Passing variables between salt states

In Saltstack, I have the following use case: There is a state redis.sls which can be included by other states. The result of redis.sls should be configured differently, depending on the state which included redis.sls. For…
lev
  • 3,986
  • 4
  • 33
  • 46
7
votes
3 answers

Is it possible to use variables in cloud-config

When using cloud init's #cloud-config to create configuration files, how would I go about using variables to populate values? In my specific case I'd like to autostart EC2 instances as preconfigured salt minions. Example of salt minion cloud…
charliemurder
  • 343
  • 1
  • 2
  • 12
6
votes
1 answer

Trigger event on Master and wait for "response event" on Salt Minion

What I want is an RPC-like behavior invoked by the Minion put into some kind of script which can then be invoked by any (non-Salt, non-Python) application and service: trigger an event on the Master (payload corresponds to command line…
muffel
  • 7,004
  • 8
  • 57
  • 98
6
votes
1 answer

What is the difference between defaults and context options in file.managed salt state?

State file.managed has defaults and context options for template rendering. Both provide context for template vars. What is the difference between them?
Raz
  • 7,508
  • 4
  • 27
  • 25
6
votes
1 answer

Vagrant up OS X Not Working

I have no clue why this vagrant build is not working. I'm trying to build with saltStack tutorial information from https://docs.saltstack.com/en/getstarted/fundamentals/index.html Getting the following error. The box 'ubuntu/trusty64' could not be…
user3066155
  • 157
  • 2
  • 2
  • 15