Questions tagged [saltstack]

SaltStack is an open source configuration management and remote execution application.

2
votes
1answer
3k views

How to install nodejs and npm packages with salt on debian

I'm struggling to install a recent nodejs version and npm packages using salt on debian. Here is my salt state: nodejs-deps: pkg.installed: - names: - g++ - curl - libssl-dev ...
3
votes
2answers
10k views

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 ...
1
vote
1answer
914 views

how to query postgresql database via salt

I need to run a query on a postgresql database in a module I'm writing for Salt. It won't do much, just query a table for a value to determine what version of the software is installed. The docs have ...
0
votes
1answer
2k views

using grain data in a custom salt stack grain

I would like to write what is effectively a "virtual grain" that determines some value based on the value of other grains, using a custom grain. Specifically, I want to provide a grain values, env, ...
7
votes
1answer
12k views

salt stack: use state jinja variables in template

What I'd like to do is generate multiple configuration files for each openvpn user. I have the IP address and additional configuration in pillar. For example: openvpn: - user1: ip: 1.2.3.4 ...
5
votes
4answers
2k views

How to enable swap with salt stack?

How can I create and enable permanent 1GB swap file with salt stack that will work after reboot? salt.states.mount.swap does not allow to define swap size. Furthermore I need to define swappiness. ...
0
votes
1answer
5k views

How would one restart a service only if it is already running, using SaltStack?

Say I have a service on several servers, controled in a cluster way (heartbeat), disable (on startup) because I want it to run only on the active node: haproxy: service.disabled: [] I want to be ...
-1
votes
1answer
222 views

Minion management from salt server

I have done salt server set up on ( ubuntu 12.04)and minion(windows server 2008 r2) as per http://salt.readthedocs.org/ , Now i want to copy a folder includes .Exe files on it to minion in specific ...
0
votes
1answer
837 views

Basic Salt File server commands not working

I have a salt master and just one salt minion with the Id saltMinion2. I installed the rpm salt-master-2014.1.10-4.el6.noarch on the master and salt-minion-2014.1.10-4.el6.noarch on the minion and ...
2
votes
1answer
714 views

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 ...
3
votes
2answers
4k views

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'...
1
vote
2answers
419 views

Cannot run SaltStack master on FreeBSD 10

I want to install SaltStack in a brand new FreeBSD 10 machine. I am following the official documentation: http://docs.saltstack.com/en/latest/topics/installation/freebsd.html But when I try to launch ...
1
vote
3answers
3k views

SaltStack targeting minions with *

I am using SaltStack on my linux boxes and want to define nodegroups. I know about compound matching and minion lists, etc. This is what I need, and it works this way, but that's hard to maintain ...
4
votes
1answer
9k views

Saltstack iterate through second level pillar data

I might be missing something or this might just be the wrong way to layout pillar data. I want to iterate through the second level of pillar data. Pillar example: repo: Option1: ...
4
votes
1answer
3k views

Delay execution of command until after something else has run

I am trying to write a deploy script with salt. It mostly works. I have to run highstate a couple of times for it work all the way. My biggest issue is working through how to execute commands one ...
0
votes
2answers
1k views

Salt-cloud docker state, handle volumes

I'm using dockerio salt state to startup docker containers on a salt minion. Trying to mount volumes into my container is failing. Container is starting but volumes are not bound. What am I missing? ...
0
votes
2answers
953 views

SaltStack minions require restart after replacing master

I'm using SaltStack to manage several servers on EC2, including both Linux and MS-Windows installations. The master server is deployable in its entirety (using cloud-init) and when I change the ...
0
votes
1answer
799 views

why does my use of the saltstack apache-formula fail to set the 'id' variable

why does my use of the saltstack apache-formula fail to set the 'id' variable ? my code is as fallows ? apache: sites: changed.com: template_file: salt://salt/formulas/salt/...
0
votes
1answer
1k views

Outputting salt-mine data into template

Can anyone spot my error here. I have the following in the minion config: mine_functions: network.interfaces: [] I expect the following to return the IP of all minions: {% for ip in salt['mine....
0
votes
1answer
806 views

Saltstack grains error in template file

Using {{ grains['host'] }} in a managed file returns the following error: Function: file.managed Result: False Comment: Unable to manage file: Jinja variable dict object has no element ...
2
votes
1answer
5k views

hostname of minion in salt command

I'm fairly new to salt so it's possible that I just missed something, but I can't figure this out. I am using salt as a command execution tool (no config management so far). I couldn't find a way to ...
2
votes
1answer
373 views

Salt Returners Returning to Master

I have several servers setup with salt, I've been using the sqlite3 returner to record all my actions. This work fine, but rows only get inserted on each minions local database. How can I accumulate ...
1
vote
4answers
2k views

Can I administer Amazon RDS instances with, Chef? Salt? Puppet? Ansible?

On the face of it, it looks like I need to be able to install some software daemons on the target nodes for these things to work. If I can't do that (e.g. an Amazon RDS instance), what are my options? ...
2
votes
1answer
2k views

Run command on Salt master before minion highstate

Is there a way to run a command (or state) on the salt-master whenever salt 'myminion' state.highstate is run, but before the minion's highstate is executed? The command is svn update or (svn.latest),...
2
votes
1answer
4k views

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/...
3
votes
1answer
873 views

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 ...
2
votes
1answer
1k views

easy_install a list of packages from a txt file with Salt

Salt already provides a pip state which can be used as: pip.installed: - requirements: requirements.txt I want to do the same with easy_install and with as minimal juggling as possible. I can ...
0
votes
0answers
300 views

Rollback Salt-stack version

I've been using salt-stack version 0.17.4 for a while on a CentOS server. I installed salt on a new server by going to the saltstack website, adding the rpm and using a yum install salt-minion and was ...
2
votes
5answers
2k views

Deploying latest .NET Framework with Saltstack

Is there an "apt-get install .NET-Framework" for Windows Server 2008+? Some way I can update to the latest .NET Framework 4+, preferably using Saltstack?
2
votes
0answers
565 views

Install New Relic using SaltStack on Windows Minion

How can I install New Relic on my Windows minions via SaltStack without having to RDP into each Windows minion? I found some New Relic documentation for installing via the command-line on Windows, ...
5
votes
1answer
924 views

How to Install RVM and RUBY to the specific user in the salt-minion

I am using Ubuntu 12.04 for salt-master and salt-minion.When i try to install a package in the salt-minion using salt, it installs only in the system specific. But i need to install in the user ...
1
vote
1answer
3k views

How to pass kwargs from a state file to my custom module?

I'm writing a custom module to create a local mirror on Ubuntu using debmirror. Here's my code: ''' Build a local mirror with debmirror. ''' import logging import os import salt.utils from salt....
2
votes
1answer
792 views

How to create packages in SaltStack

I have installed Salt-master in my ubuntu 12.04 machine and salt minion in ubuntu 12.04. I want to install package containing like svn,mongodb,postgres,maven,python in the salt-minion. how to create ...
0
votes
1answer
770 views

Ensuring data consistency in s3 with multiple users writing/reading

I need advice/ ideas about how can I ensure data consistency in my s3 bucket. I have 2-3 users pushing and reading resources from s3. As one can easily see this leads to data inconsistency( User A is ...
5
votes
1answer
10k views

Adding Single Line to File with SaltStack

I would like to add the following lines to all /etc/sudoers files across my environment: # Administrators LDAP Group %Administrators ALL=(ALL) ALL However, each server has a different /etc/...
0
votes
1answer
537 views

How to install pip and other specific python modules onto a CentOS server that is air-gapped from the internet?

Ultimately, I'm trying to install SaltStack on a super computer that has no internet connection. And I'm not allowed to hook it to the internet. So far, I have installed an entire yum repo on the ...
21
votes
2answers
16k views

Configuration management: push versus pull based topology

The more established configuration management (CM) systems like Puppet and Chef use a pull-based approach: clients poll a centralized master periodically for updates. Some of them offer a masterless ...
0
votes
1answer
301 views

Start a sub provision in Salt

I need to have two project. One is to set up the server. The other is the web app. I'm trying to use SaltStack to do this via Vagrant. What I want to happen is that after the server is provisioned,...
2
votes
1answer
485 views

How to configure SaltStack to work on other machines

I have installed SaltStack in my system (Ubuntu 12.04). for example If i want to run sudo apt-get update or wget to other machines like 4 to 5 machines using Salt. How should i want to configure my ...
7
votes
2answers
7k views

SaltStack: How one can execute a state only once?

I have to execute a state only once. I couldn't find a simple way to do this. Now, the context I install two MySQL servers through salt. I want to make one a slave of the other. In order to setup ...
0
votes
2answers
777 views

Saltstack master has dynamic ip address

What is the best way to manage a minions master location when the master within SaltStack has a dynamic IP address? Is there a way to automatically update the minions (master) IP address?
0
votes
1answer
471 views

How would I template an SLS using saltstack

I'm trying to do proof of concept with Mongodb(sharding) and Id like to run a command every time I spin up a new cluster without having to add lines in all my sls files. My current init is as follows: ...
0
votes
1answer
172 views

Saltstack: is it possible to forbid certain commands when using cmd.run?

Let's say I have a salt-master and decide to run some arbitrary command in all my minions. But because I had a bad night, I was robbed on my way to work, my boss yelled at me for being late and my co-...
5
votes
1answer
2k views

How to create salt from pillar using saltstack?

Lets take an example of what I have today: https://gist.github.com/Natim/6548009 I use the pillar to create a database and a user. It works fine on server with one of the roles but if I need both ...
11
votes
2answers
12k views

deploy ssh key from master to minion via salt pillars

I have two ssh keys that I'm trying to deploy to one of my minions. But I can't seem to get it to deploy. It errors out. Here is the init.sls in pillars: /xxx/yyy/zzz/id_rsa: file.managed: - ...
4
votes
1answer
1k views

Verifying Salt states before committing

I'm storing my salt sls files in a git repository, but I have the perennial problem that I can't verify my YAML represents a valid set of states that could be applied (I've also had difficulty ...
3
votes
1answer
3k views

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? ...
75
votes
6answers
53k views

How do I list all connected Salt Stack minions?

Sometimes my saltmaster hangs for a while on salt '*' test.ping waiting for downed minions to reply. Is there a way so see a list of connected minions, regardless of whether they respond to test.ping?
5
votes
1answer
852 views

Reloading Salt grains

I'd like to download a grains file from external source during the state.highstate is run. The file is not supposed to change usually - I'm only using this mainly for the initial provisioning. So it ...
5
votes
3answers
4k views

View file contents on a Salt Stack minion

How do I output the contents of a file on all my minions using Salt Stack? The only 'pull' functionality I can find is in this minion push commit, but this requires configuration changes on the ...