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

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
  • 143
  • 1
  • 2
  • 7
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,591
  • 17
  • 72
  • 123
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,591
  • 17
  • 72
  • 123
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,591
  • 17
  • 72
  • 123
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
0
votes
2 answers

SaltStack: Do "etckeeper init" if /etc/.git is not there

I want to deploy the tool etckeeper via SaltStack. Installating the RPM/DPKG is easy. Next step is to call etckeeper init after the installation. My current idea is this pseudo-code: execute etckeeper init if /etc/.git does not exist I read the…
guettli
  • 3,591
  • 17
  • 72
  • 123
0
votes
1 answer

How do I use debconf in salt with pillars?

I have the following: newrelic-debconf: debconf.set: - name: newrelic-php5 - data: 'newrelic-php5/application-name': { 'type': 'string', 'value': '{{ salt['pillar.get']('newrelic:applicationName', '') }}' } …
0
votes
0 answers

SaltStack: Reason why postgres_user.absent fails?

The Salt state postgres_user.absent fails: ID: remove_foobar_vums_dci__database_user Function: postgres_user.absent Name: foobar_vums_dci Result: False Comment: User foobar_vums_dci failed to be removed Started:…
guettli
  • 3,591
  • 17
  • 72
  • 123
0
votes
1 answer

Using salt-ssh for Ubuntu/Debian patching (dialog frontend is not usable)

I'm looking into replacing a Linux based home-grown patch management solution with salt-ssh. The current system uses a shell script to iterate through a list of hosts and copies a script named apt-update to the remote. After copying the script, the…
Server Fault
  • 3,714
  • 12
  • 54
  • 89
0
votes
2 answers

Automate PostgreSQL Upgrade

Our manual recipe to do a PostgreSQL version upgrade (example from 9.6 to 10.1) looks like this at the moment: stop DB (via systemctl) start DB on a different port pg_dumpall using the different port mv old data directory to a different…
guettli
  • 3,591
  • 17
  • 72
  • 123
0
votes
2 answers

How can I make salt-api return more useful data?

salt-master: 2016.11.5 (Carbon) salt-api: 2016.11.5 (Carbon) salt-minion 2016.11.5 (Carbon) cherrypy: 10.2.2 After setting up salt-api using this tutorial I've been able to successfully use the API via curl. For example, I can move files. …
trueCamelType
  • 1,086
  • 5
  • 20
  • 42
0
votes
1 answer

How to create mysql user with REQUIRE SSL using SaltStack?

I have create mysql user using SaltStack but it does not include SSL. My salt code: {{ pillar['mysql_user'] }}: mysql_user.present: - host: "{{ mysql_bind_address }}" - password: "{{ pillar['db_password'] }}" - connection_user: root …
iWizard
  • 418
  • 3
  • 12
  • 27
0
votes
1 answer

Salt-Cloud and local development

I want to create basic aws infrastructure(vpc,subnets,route tables/routes,ec2 boxes) using saltstack. I am using a centos vagrant box as my salt master and minion as well to create vpc, subnets and routes using salt states. But the problem occurs…
Ankita13
  • 101
  • 1
0
votes
1 answer

Move $HOME of user postgres from /var/lib to /home via SaltStack

I want to move $HOME of user postgres from /var/lib to /home via SaltStack. Here are the steps which happen before: postgres RPM gets installed $HOME is /var/lib Database gets initialized In this case a imperative way (tell tool to do X) would be…
guettli
  • 3,591
  • 17
  • 72
  • 123