Questions tagged [salt-stack]

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 saltstack tag on Server Fault.

1444 questions
6
votes
1 answer

Creating AWS EC2 instance image using saltstack?

Has anybody tried creating AWS AMI(image) using saltstack. I tried using it was able to create new instance from existing AMIs but how to create image using salt-cloud? Also attempted by using boto_ec2 but its give error that Module 'boto_ec2' is…
6
votes
1 answer

Chef like version management in salt stack?

I really like the way that you can upload multiple versions of the same cookbook to Chef server. And also you can specify the cookbook version in metadata file. e.g. depends 'base-config', '= 1.2.1' I like Salt. However, I couldn't find any…
sfresher
  • 61
  • 2
6
votes
1 answer

How do I implement a 'pillar.example' from a SaltStack Formula?

If this explanation exists somewhere, I've spent 3 months trying to find it, and failed. I come from a Puppet background, however for various reasons I really want to try replacing it with Salt. I've gotten a basic setup and I can code my own states…
Routhinator
  • 3,559
  • 4
  • 24
  • 35
6
votes
3 answers

How do I get status, logs of last run `state.highstate` in Salt?

I applied state using: $sudo salt 'api-*' state.highstate -l debug -v Some states failed and I scrolled down, fixed some and now I can't scroll up (my terminal doesn't save full session) to see the stdout. Now I don't want to run high state again.…
avi
  • 9,292
  • 11
  • 47
  • 84
6
votes
1 answer

How to change ownership, or chown -R user:user equivalent with saltstack?

I'm just learning saltstack to start automating provisioning and deployment. One thing I'm having trouble finding is how to recursively set ownership on a directory after extracting an archive. When I use the user and group properties, I get a…
user797963
  • 2,907
  • 9
  • 47
  • 88
6
votes
2 answers

saltstack: creating directory only if does not exists

Currently I have the following rule for creating a directory /init/dir: file.recurse: - source: salt://init_dir/init - user: name - group: group - name: /path/init - dir_mode: 2775 - file_mode: 777 Now I want to create…
cmidi
  • 1,880
  • 3
  • 20
  • 35
6
votes
1 answer

Saltstack - Preview Highstate

Is there a way to preview what files will be served to a minion on a state.highstate? I know that you can run state.show_highstate, but that is not the output I am looking for. For example, inside /path/to/recurse/dir/ I have foo.txt and bar.txt and…
feus4177
  • 1,193
  • 1
  • 11
  • 15
6
votes
1 answer

Are conditionals in salt stack pillar templates secure?

I recently saw the following construction in a salt pillar in a thread here /srv/pillar/ssh.sls: ssh_certs: {% if grains['fqdn'] == 'server1.example.com' %} dsa: | -----BEGIN DSA PRIVATE KEY----- {# key text goes here with…
gepoch
  • 711
  • 6
  • 17
6
votes
1 answer

replacing a file with a symbolic link in a salt state

I'm new to salt-stack. I'm trying to make sure a symbolic link exists. /etc/localtime: file.symlink: - target: /usr/share/zoneinfo/Europe/Paris - file.exists: - name: /usr/share/zoneinfo/Europe/Paris The result is as excepted when…
Pierre
  • 63
  • 1
  • 3
6
votes
5 answers

How can I get the free memory available on minions using on salt?

I am looking for a simple way to get information about memory usage, like free memory form the salt minions. So far I know that the total memory can be listed using salt '*' grains.items but I don't even know how to list only just the total memory…
sorin
  • 161,544
  • 178
  • 535
  • 806
6
votes
3 answers

How to set root password using salt states

I want to set strong password for mysql root user. But there is a egg-hen problem. I have empty server. I salt it. The root password is empty (by default after install). If I use root: mysql_user.present: - name: root - password:…
Tomáš Fejfar
  • 11,129
  • 8
  • 54
  • 82
6
votes
1 answer

How do I make one custom state dependent on another?

How do I make one custom state dependent on another with a requisite in an sls file? Example: Two custom states in a _states/seuss.py module: # seuss.py def green_eggs(): return {'name': 'green_eggs', 'result': True, 'comment': '', 'changes':…
Jeff Bauer
  • 13,890
  • 9
  • 51
  • 73
6
votes
1 answer

Saltstack grouping commands

If I have to execute the following 3 commands, how do I group them so I only have to call one? salt '*' git.fetch cwd=/var/git/myproject opts='--all' user=git salt '*' git.pull cwd=/var/git/myproject opts='origin master' salt '*' nginx.signal…
Marconi
  • 3,601
  • 4
  • 46
  • 72
5
votes
3 answers

Jenkins configurations gets reverted by SYSTEM user anomaly

I am running Jenkins version 2.85 on Kubernetes as pod(Affinity set to one workernode). I am creating Jobs using Salt Jenkins module by passing XML to this module. I am using Jenkins Global Library for preforming job execution. My Job config looks…
5
votes
2 answers

Conditional Salt State

I have a scenario where I need to take an action if another service is already running. Specifically, I want to install snmp monitoring if, for example, mysql is already running. I know the "right" way to do this is to install mysql and its…