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

Securely copy file from one Salt minion to another

How do I use Salt to securely copy a sensitive file (a cryptographic key) from one specific minion to another specific minion? I don't want any other minion to be able to read the file. Salt Mine? The Salt Mine seems to be a logical place to start,…
Richard Hansen
  • 3,640
  • 1
  • 18
  • 17
3
votes
1 answer

Running postgres_database.present a second time causes error "has wrong parameters which couldn't be changed on fly"

Running a salt state that looks like the following to create a postgres database for django... django-db: postgres_database.present: - encoding: 'UTF-8' - owner: djangouser - db_user: postgres When I run it the first time, so far, so good: …
3
votes
1 answer

How to set hostname with salt-cloud command

I am using salt-cloud to create new aws instances: salt-cloud -p base_ec2_micro test.mydomain.com However, the instance gets its ip as hostname. What can I do to set the fqdn as hostname? Thanks
Cramix
  • 115
  • 10
3
votes
1 answer

How should I backup pillar data for SaltStack?

It makes sense to backup the salt state to a git repo since there shouldn't be any sensitive data in there. But what about the pillar data? Should I just create a separate git repo for that, or put it in an S3 bucket, or encrypt the data somehow?
syvex
  • 141
  • 4
3
votes
1 answer

How do I make cmd.run answer a prompt in salt-stack?

I've got a salt script that is being executed with state.sls like this: salt '*' state.sls foo.bar In my script I've got this: foo-bar: cmd.run: - php foo.php bar --delete - cwd: /srv/foo The --delete flag will cause the script to…
simbabque
  • 207
  • 1
  • 4
  • 9
3
votes
1 answer

generating ssh-keys for a non root user with salt

I need to generate ssh-keys(public/private pair) for a user say helen. This user is already in all my salt minions. How do I generate ssh keys for this user from my salt master? For root user I generated the keys using this command and it worked…
Ajo Augustine
  • 1,252
  • 4
  • 16
  • 21
3
votes
2 answers

saltstack: how to re-push a key from a salt-minion to a salt-master?

The short version: How to get test.ping to work, after keys are -Added? And how to re-push a key if you -Deleted it from the master? The long version: Steps to reproduce: on two RPIs install the latest Raspbian on an RPI from the…
user246604
  • 131
  • 1
  • 1
  • 5
3
votes
1 answer

Simple web tool for viewing log

I'm developing a server deployment script that installs a bunch of stuff and generates a log in the process. I'd like users of the script to be able to view what's happening, on a web page, in real time (eg, without browser refresh). What's a simple…
Steve Bennett
  • 5,539
  • 12
  • 45
  • 57
3
votes
2 answers

How do I list IP addresses where minions connect from?

Some minions are behind NAT and I'd like to get their public IP address as seen from master (for firewall purposes). There is external_ip grain but AFAIK it depends on third party service and doesn't even work reliably for me.
Juraj
  • 257
  • 3
  • 9
3
votes
1 answer

SaltStack pillar includes under same key

I couldn't find anything in documentation about having multiple includes under the same key, but when I tried it, I ended up with only that last include keys under the root key. For example: /srv/pillar/top.sls base: '*': - ports cat…
LavaScornedOven
  • 253
  • 2
  • 10
3
votes
1 answer

LXC and Saltstack minion_id configuration on Ubuntu

I'm using LXC as a lab platform for testing SaltStack scripts. The lab consists of +5 Ubuntu 12.04 LTS containers, which I create by cloning a template container with salt-minion pre-installed. Once I create the template container and install…
LavaScornedOven
  • 253
  • 2
  • 10
3
votes
1 answer

Structuring Salt State Files for Staged Environments

How should Salt State Files and Pillar configurations be structured to enable smooth deployment of varying minion roles for staged environments like dev, qa and production as well as feature branches? I have arranged my root and pillar state files…
Petrus Theron
  • 1,541
  • 5
  • 16
  • 24
3
votes
6 answers

Monitor servers for changes made outside of automation software

The company I work for is currently investigating the deployment of an centralized automation system (like Salt or Puppet) for our servers (all Ubuntu/FreeBSD). We will probably go along with Salt, but I think it is irrelevant to my question. My…
Wiesław Herr
  • 340
  • 1
  • 9
2
votes
2 answers

SaltStack: found conflicting ID

My sls file: /etc/sudoers.d/foo: file.managed: - contents: | foo ALL = NOPASSWD: /usr/bin/systemctl restart minio_storage-foo.service foo ALL = NOPASSWD: /bin/systemctl restart minio_storage-foo.service - template: jinja -…
guettli
  • 3,113
  • 14
  • 59
  • 110
2
votes
0 answers

How can I set user/group ownership on a SaltStack git clone?

I have a hand-maintained Bugzilla installation that I'm trying to move to being managed with SaltStack. Currently I have the following .sls file to set up the clone: https://github.com/bugzilla/bugzilla.git: git.latest: - rev:…
strugee
  • 901
  • 10
  • 25