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.

281 questions
0
votes
1 answer

sending command to salt from fail2ban

what I'm trying to do is modify my action.d/iptables-allports.conf: actionban = ssh fail2ban@saltmaster.net 'salt '*' iptables.insert position=1 rule='-s -j DROP -m comment --comment " | | hits: | time:
0
votes
1 answer

Salt: Read property file into Postgres database

I have a Salt script that, among other things, initializes a Postgres database. After initializing the database, I want to read some properties from a file, and do an INSERT (into a configuration table) for each key/value pair. I've seen Salt's…
Jorn
  • 501
  • 1
  • 4
  • 14
0
votes
2 answers

How to install python module(s) via pip using salt?

I need to install the paramiko module of python on multiple machines using the salt stack. I looked at the documentation about how to do this, but was not able to understand the syntax. Can someone please explain me line-by-line what happens in the…
Kristof Tak
  • 257
  • 1
  • 3
  • 14
0
votes
3 answers

Terraform, how to provision droplet with salt-minion (masterless)

I've managed to get a local development server running with Vagrant, provisioning it with Salt in a masterless configuration. Now, I'm trying to take advantage of the existing salt states to provision a production server, but so far haven't figure…
nunop
  • 211
  • 3
  • 10
0
votes
1 answer

Installing a gem using saltstack with --user-install option

I want to replicate the following step of a deployment in saltstack, as a given user: gem install --user-install bundler I checked the documentation and I was still unsure as to how to do this. I tried the following: bundler-install: …
Rumbles
  • 994
  • 1
  • 12
  • 28
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
  • 780
  • 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,591
  • 17
  • 72
  • 123
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,591
  • 17
  • 72
  • 123
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,578
  • 4
  • 28
  • 52
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,032
  • 2
  • 12
  • 31
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
  • 739
  • 4
  • 15
  • 27
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
  • 780
  • 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