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.

277 questions
0
votes
1 answer

Saltstack Appending variable to itself via for loop

Alright, I'm using salt to manage my grub.conf boot options (most importantly the isolated CPU's) in linux, and have a basic formula to accomplish that: {% set cpu1 = (grains['num_cpus']-1) %} {% set cpu2 = (grains['num_cpus']-2) %} {% set cpu3 =…
Gravy
  • 770
  • 1
  • 5
  • 17
0
votes
1 answer

Salt: inject service.watch?

Example from: https://docs.saltstack.com/en/latest/topics/tutorials/states_pt2.html /etc/httpd/extra/httpd-vhosts.conf: file.managed: - source: salt://webserver/httpd-vhosts.conf apache: pkg.installed: [] service.running: - watch: …
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
2 answers

Set value in /etc/zypp/zypp.conf via salt

I would like to set the following setting in /etc/zypp/zypp.conf via salt: solver.allowVendorChange = true How to do this? There is a module for zypper, but I found no way to update the above…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
1 answer

How do I provision a new LXC container using saltstack?

I've got a host server which runs Jenkins. I'd like Jenkins to automatically create new containers and prepare those containers with SALT. The ultimate purpose is to use these containers to test code. What is the best way to create a new container,…
sbrattla
  • 1,456
  • 3
  • 26
  • 48
0
votes
1 answer

Adding MySQL user with different hosts in SaltStack

I have two servers running the same application with a need to access a database on one specific database server running MySQL. Both servers with the application should access the MySQL DB with the same user credentials. At the same time, the MySQL…
PythonLearner
  • 1,022
  • 2
  • 12
  • 29
0
votes
1 answer

SaltStack - generate pillar value base on what folder it is being executed

Hi ServerFault Community, I'm trying to learn SaltStack and now I'm facing a problem. I have a property file (propertyfile.properties) with values being populated by salt pillar. Now this property file exists in multiple directories. The issue that…
Master_A2Z
  • 25
  • 3
0
votes
2 answers

Is there a way in Salt to use a different configuration file for a single command?

I'm working in an environment where changes in salt states and pillar must be reviewed through merge request. At the moment, when we need to test our changes before submitting them, we log on the salt master, checkout the branch we're working on…
iodbh
  • 214
  • 1
  • 10
0
votes
1 answer

How can I run a salt state if a command prints zero rows?

I've got Salt and SELinux running on CentOS7. I want to run restorecon -Rv /path/to/something, but only if it's necessary. I know that Salt has the onlyif and unless commands, but I'm having a heck of a time googling for what I want. I want to write…
Wayne Werner
  • 709
  • 4
  • 14
  • 26
0
votes
1 answer

Saltstack Accessing pillar inside salt['cmd.run']

I'm trying to configure a state that will look at the home directories of the system, and iterate through them to check for specific files. To accomplish this I originally wrote up: {% for userdir in salt['cmd.run']('ls /home').split('\n') %} for…
Gravy
  • 770
  • 1
  • 5
  • 17
0
votes
1 answer

How can I loop over all minions in a pillar top file?

I would like to add some generic pillar data to minions based on roles, but also offer a way to customize each machine based on hostname (minion id). In my pillar/top.sls file I have base: '*': - pkgs/common-ubuntu-pkg - fail2ban/config …
chugadie
  • 201
  • 1
  • 5
0
votes
1 answer

salt stack `os:...` pattern not matching in top.sls

I'm attempting to differentiate between a Ubuntu box and an Arch box within my top.sls file within a Virtualbox 5.0.4 virtual machine managed by vagrant 1.7.4 using salt 2015.8.1 (Beryllium) This doesn't work: base: 'os:Arch': -…
lsh
  • 148
  • 1
  • 12
0
votes
0 answers

What is {{ self }} in Jinja2 templating system

On the SaltStack documentation: It is explained that: 'node_type:web': - match: grain - webserver 'node_type:postgres': - match: grain - database 'node_type:redis': - match: grain - redis 'node_type:lb': - match: grain - lb Can…
MarAja
  • 203
  • 3
  • 6
0
votes
1 answer

Why I am getting multiple responses from salt-minions?

I got the first response of all minions in valid json string but then I am getting three another different responses from same minions which are invalid json strings. root@localhost:/home/i-kod/Desktop/ass1# salt --out json --static '*' test.ping…
I-Kod
  • 21
  • 1
  • 1
  • 3
0
votes
1 answer

Syntax error in SaltStack state file

I am newbie with SaltStack. I have an error in one of my first state files. The state file is: openvpn: pkg.installed: [] /etc/openvpn: file.recurse: - source: salt://myvpn/openvpn-files service.running: [] And the error: State…
pbacterio
  • 276
  • 2
  • 6
0
votes
1 answer

Installing packages inside a docker container using saltstack

Ive have been looking for tutorials to help me understand it but my searches has been unsuccessful. so I was wondering if it is possible for a Saltstack Master to install packages, say apache-mysql-php, inside a docker container started inside a…
vivek o.s
  • 9
  • 3