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: normalize Package name

I would like to have less conditions in my saltstack sls files. Up to now it looks like this: foo_package: pkg.installed: - pkgs: {% if grains.os_family == 'Debian' %} - foo_BAR {% else %} - foo-bar {% endif %} I would…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
2 answers

saltstack equivalent of puppet last_run_summary.yaml

Does Salt have the equivalent of Puppet's last_run_summary.yaml? If not, what's the suggested way to monitor the success or failure of executions on individual salt minions?
user162988
  • 11
  • 3
0
votes
1 answer

Saltstack: How to install a new zypper RPM Repo?

How to add a new rpm package repo via saltstack? I checked the docs, and only see method to list, modify or delete repos: https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.zypper.html I would like to do this: root@server# zypper ar…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
1 answer

Saltstack formulas (starter)

Is any saltstack formula 'skeleton' available so it can create a structure as described here? In chef you have knife cookbook create or in ansible ansible-galaxy init.
silviud
  • 2,677
  • 2
  • 16
  • 19
0
votes
1 answer

Salt: Raise Error if file.replace did not find anything to replace

Maybe I am blind, but I could not find a way to let the salt-ssh call fail, if file.replace did not replace a single line. If the pattern I provide did not match, then I want to get noticed. Example: enable_foo: file.replace: - name:…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
1 answer

Jinja "for loop" statement with multiple lines (saltstack)

When using salt for specifying user creation, it is unorganized to have the for statement in a single line. Example: {% for USR in 'hewey','dewey','loui' %} Is it possible to break this into separate lines like: {% for USR in %} {% 'hewey', %} {%…
David
  • 1
0
votes
2 answers

Salt: file.replace on a list of files (globbing)

I use file.replace and would like to use this not on a single file, but on a list of files. The list of files comes from globbing. Example: I want to modify /etc/ImageMagick*/policy.xml. The file can be /etc/ImageMagick-6/policy.xml or…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
1 answer

Salt: file.replace: ignore_if_missing gets ignored?

I want to enable logging of an fstp server like this: https://serverfault.com/a/74234/90324 But salt does nothing. I reduced it to this: enable_logging_of_sftp: file.replace: - name: /etc/ssh/sshd_config - pattern: Sxxxxubsystem -…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
1 answer

How to instal vim using salt stack?

I have salt-stack maser and minion servers which running on centos7. I want to install vim package in minion server. For that I have created srv directory and vim.sls file under etc. My vim.sls file looks like this. vim: pkg: -…
Janith
  • 213
  • 2
  • 4
  • 8
0
votes
1 answer

Salt Stack file.recurse Recurse Failed

I built a state file in salt to copy a list of check_mk Nagios scripts down to the remote server. Below is a snip of the state file. check_mk_defined_checks: file.recurse: - name: /usr/lib/check_mk_agent/local - source: salt://{{ slspath…
Edwardcode
  • 113
  • 1
  • 2
  • 6
0
votes
1 answer

.mount a folder from the salt:// share onto a minion?

I'm trying to write a state that will mount the folder currently in the "salt://" directory with the sophos installer, run the installer.sh, then unmount it. I'm hoping to avoid copying the whole folder or setting up a file share just for this…
rootchord
  • 48
  • 6
0
votes
1 answer

SaltStack: Disable Cron during run

I would like to disable cron on the minion when salt gets executed. Disabling it would be easy: service.disabled But how to enable it again (in all cases (success or error))? What I want is comparable with a context-manager in the python programming…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
0 answers

SaltStack: --failhard for salt-ssh

I would like the execution of salt-ssh to cancel on the first error. I read this: https://docs.saltstack.com/en/latest/ref/states/failhard.html But I am using salt master-less with salt-ssh. Is there a way to cancel on the first error. Of course I…
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
1 answer

SaltStack: ImportError: No module named backports.ssl_match_hostname

I get this exception: ===> salt-ssh remote-host cmd.run 'id' remote-host: ---------- retcode: 0 stderr: Traceback (most recent call last): File "/var/tmp/.root_483e1e_salt/salt-call", line 15, in
guettli
  • 3,113
  • 14
  • 59
  • 110
0
votes
1 answer

Salt modules in state file

salt.modules.iptables is great to use from command line but how can I use this in a state file. First I want to check if iptables is running: check_process: cmd.run: - name: ps aux | grep 'iptables' Return True If true: Then I will use…
BdK
  • 1
  • 1