Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [saltstack]

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

2
votes
1answer
359 views

Proxmox API returns cryptic error when creating a container with salt-cloud

I'm using a stock Proxmox with salt-cloud to automatically provision lxc containers. Salt's provisioning fails while attempting to create any container with this cryptic error message: Can't call ...
1
vote
2answers
589 views

saltstack: use a Python module in both states and pillar

I have a custom module with a function that i can use in my states like this {% set myvar = salt['mymodule.myfunction']() %} Now I want/need to use it in my pillar. I have tried calling it the same ...
-5
votes
2answers
121 views

Configuration Managment Best Practice: List of Packages to install

Package names do differ on different platforms. Some call it httpd some apache2... Imagine your product supports RedHat, SuSE and Ubuntu. Each in two versions. Do you keep six lists of packages to ...
0
votes
1answer
246 views

Assign IP address using saltstack

How can I use Execution Modules and also State Modules to assign IP addresses to linux minions? It's simple to do this on minions using windows, I'm not sure how to do this for linux minions.
0
votes
1answer
187 views

RPM to DPKG: Underscore in Package Name

I have a custom RPM which I convert to DPKG using the tool alien. It works with one annoyance: The input is called "foo_bar.rpm" and the output is called "foo-bar.dpkg". We have a list of packages ...
0
votes
1answer
48 views

Installing a package using Salt takes too long

I'm trying out Saltstack 2015.08 on my openSUSE Tumblweed x86_64 machine. I have a trivial local setup which ends up installing a single package: install_apache_2: pkg.installed: - pkgs: -...
1
vote
1answer
1k views

Apply states on minions after they come online

Imagine you want to apply some states on a group of minions, such as all ubuntu clients. It's possible by the time we apply that states some of the minions are offline. How long do states remain in ...
2
votes
1answer
1k views

Upgrading SaltStack Master & Minion if installed using bootstrap script

As the title stated, how do I upgrade SaltStack (both Master and Minion) if I installed them using the bootstrap.sh script?
0
votes
0answers
235 views

Master don't receive the minon key

Well, i installed salt-minion in some computers, but it just don't send any key to be acepted, i reinstall the salt-minion three times in each computer, and it doesn't work, somebody can help? No ...
1
vote
1answer
46 views

Will there be any problems if SaltStack dirs are subdirs of /srv/salt?

Most of the examples -- and also the documentation -- of SaltStack put the states files under /srv/salt and the pillars files under /srv/pillar. This means if I want to track the files using a source ...
2
votes
1answer
177 views

restrict output from salt command only to those minions for which it is able to connect

When you issue a salt call from salt master (eg. salt '*' test.ping), the output includes the minions that it is unable to talk to, with the hostname and then on the next line a message "Minion did ...
1
vote
1answer
771 views

Saltstack for firewalld

I am trying to get a state set up so that I can add the associated ports open in firewalld. Tried every example I can find and all fail. Here is my current: firewalld: service.running: - ...
12
votes
3answers
10k views

SaltStack: Call a single state of a sls file

I fail to call a single state of an sls file. Whole sls file works This works: salt-ssh w123 state.sls monitoring This works: salt-ssh w123 state.show_sls monitoring One item of above output: ...
0
votes
1answer
993 views

Error when installing a WIndows application from salt master

I am trying to install Icinga via salt on a Windows server 2012 R2. I have created an icinga.sls file and stored it in /srv/salt/win/repo-ng. File contents: icinga: '2.4.7': full_name: '...
1
vote
1answer
1k views

Saltstack: Jinja error: How to get SLS file name and line number that contains the error?

I get this error message after refactoring my sls files. I created new sls files and use the include directive to have more modular formulars. salt:/srv # salt-ssh w123 -v state.sls monitoring ...
0
votes
1answer
264 views

sending command to salt from fail2ban

what I'm trying to do is modify my action.d/iptables-allports.conf: actionban = ssh fail2ban@saltmaster.net 'salt '*' iptables.insert position=1 rule='-s <ip> -j DROP -m comment --comment "<...
-1
votes
1answer
187 views

What does bind to interface mean in Salt?

In the SaltStack master configuration there is the interface option: https://docs.saltstack.com/en/latest/ref/configuration/master.html It specifies the "The local interface to bind to". What does ...
0
votes
1answer
169 views

Salt: Read property file into Postgres database

I have a Salt script that, among other things, initializes a Postgres database. After initializing the database, I want to read some properties from a file, and do an INSERT (into a configuration ...
3
votes
1answer
2k views

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? ...
0
votes
2answers
5k views

How to install python module(s) via pip using salt?

I need to install the paramiko module of python on multiple machines using the salt stack. I looked at the documentation about how to do this, but was not able to understand the syntax. Can someone ...
0
votes
3answers
1k views

Terraform, how to provision droplet with salt-minion (masterless)

I've managed to get a local development server running with Vagrant, provisioning it with Salt in a masterless configuration. Now, I'm trying to take advantage of the existing salt states to provision ...
0
votes
1answer
155 views

Installing a gem using saltstack with --user-install option

I want to replicate the following step of a deployment in saltstack, as a given user: gem install --user-install bundler I checked the documentation and I was still unsure as to how to do this. I ...
0
votes
3answers
460 views

Auto-Retry Config Push with Ansible or Saltstack?

I'm trying to choose a configuration management system for 500-2000 very-geographically-distributed hosts. Due to varying network reliability, it's possible that a number of hosts may be temporarily ...
2
votes
4answers
2k views

How can I ensure only salt-managed files remain in directory and keep the diff clean?

Assume a directory like this: - etc/nginx/sites-available/ - hostA - hostB - hostC Where hostA and hostB are created by salt. hostC was created earlier by salt as well, but since than it ...
1
vote
1answer
159 views

Saltstack Cannot Find Bundle

Maybe I don't understand how cmd is working, but here is some of the config I am using. This used to be a jruby install but we are moving to MRI, hence the jruby username: /home/jruby/tmp/rvm-install....
0
votes
1answer
506 views

Saltstack Appending variable to itself via for loop

Alright, I'm using salt to manage my grub.conf boot options (most importantly the isolated CPU's) in linux, and have a basic formula to accomplish that: {% set cpu1 = (grains['num_cpus']-1) %} {% set ...
1
vote
1answer
142 views

Salt: Properties for pillar data?

I would like to have properties (computed attributes) for data from saltstack pillars: We structure our systems like this: systems: - customer: foo project: bar stage: p ... - ...
0
votes
1answer
65 views

Salt: inject service.watch?

Example from: https://docs.saltstack.com/en/latest/topics/tutorials/states_pt2.html /etc/httpd/extra/httpd-vhosts.conf: file.managed: - source: salt://webserver/httpd-vhosts.conf apache: pkg....
0
votes
2answers
143 views

Set value in /etc/zypp/zypp.conf via salt

I would like to set the following setting in /etc/zypp/zypp.conf via salt: solver.allowVendorChange = true How to do this? There is a module for zypper, but I found no way to update the above ...
0
votes
1answer
287 views

How do I provision a new LXC container using saltstack?

I've got a host server which runs Jenkins. I'd like Jenkins to automatically create new containers and prepare those containers with SALT. The ultimate purpose is to use these containers to test code. ...
0
votes
1answer
546 views

Adding MySQL user with different hosts in SaltStack

I have two servers running the same application with a need to access a database on one specific database server running MySQL. Both servers with the application should access the MySQL DB with the ...
2
votes
1answer
170 views

SaltStack - Copy war file into JBoss 5.1 using SALT

Hi ServerFault community, I have a war file that I want to deploy in JBoss 5.1 via Salt. 'archive.extracted' module seems to not work. I've read in salt docs about 'jboss7.deployed' module but I ...
4
votes
1answer
734 views

SaltStack: schedule highstate in batch

I would like to schedule a highstate to run every night but not in parallel. Is there a way to add batch option to the scheduling system? Example: schedule: highstate: enabled: True ...
0
votes
1answer
396 views

SaltStack - generate pillar value base on what folder it is being executed

Hi ServerFault Community, I'm trying to learn SaltStack and now I'm facing a problem. I have a property file (propertyfile.properties) with values being populated by salt pillar. Now this property ...
2
votes
1answer
215 views

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: ...
0
votes
2answers
549 views

Is there a way in Salt to use a different configuration file for a single command?

I'm working in an environment where changes in salt states and pillar must be reviewed through merge request. At the moment, when we need to test our changes before submitting them, we log on the ...
0
votes
1answer
424 views

How can I run a salt state if a command prints zero rows?

I've got Salt and SELinux running on CentOS7. I want to run restorecon -Rv /path/to/something, but only if it's necessary. I know that Salt has the onlyif and unless commands, but I'm having a heck ...
1
vote
1answer
1k views

Saltstack events not firing or reactor system not responding

I've got a master and minion connected, and I'm trying to set up some monitoring via the reactor system on the master. I haven't gotten far at all though, because so far as I can tell, events aren't ...
0
votes
1answer
1k views

Saltstack Accessing pillar inside salt['cmd.run']

I'm trying to configure a state that will look at the home directories of the system, and iterate through them to check for specific files. To accomplish this I originally wrote up: {% for userdir in ...
1
vote
1answer
122 views

How do I determine which minions are receiving a particular SLS as part of their highstate?

I have a formula in my salt tree that I believe is dead code; that is, not actually being used anywhere. I'd like to get rid of it. How can I verify that no minions are receiving a given .sls as part ...
2
votes
2answers
530 views

Salt dockerng.image_present returns missing Docker credentials

Am trying create a state file sls to make sure latest image is available before launching docker container using salt. my salt-minion version is 2015.8.1 and my docker-py version 1.5 prep sentry ...
0
votes
1answer
986 views

How can I loop over all minions in a pillar top file?

I would like to add some generic pillar data to minions based on roles, but also offer a way to customize each machine based on hostname (minion id). In my pillar/top.sls file I have base: '*': ...
0
votes
1answer
155 views

salt stack `os:…` pattern not matching in top.sls

I'm attempting to differentiate between a Ubuntu box and an Arch box within my top.sls file within a Virtualbox 5.0.4 virtual machine managed by vagrant 1.7.4 using salt 2015.8.1 (Beryllium) This ...
-1
votes
1answer
430 views

SaltStack: install packages based on role

I would like to install Nagios plugins based on server role. The solution below works but I'm sure there is a more elegant/recommended way to achieve the same - any help would be appreciated. I don't ...
1
vote
1answer
1k views

SaltStack: How do I configure the minion to use a different publisher port?

Now I am having a salt-master behind an NAT, the master's 4505 and 4506 ports have been mapped to the 44505 and 44506 ports on the router. There's a master_port option but I think that only changes ...
0
votes
1answer
949 views

How to provision dashboards into kibana?

I am giving my developers the gift of kibana using the elasticsearch that is bundled with logstash. They will have kibana in their vagrant boxes. Goal: Install and configure kibana dashboards via ...
2
votes
0answers
464 views

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

Salt-Stack copy directory from salt master to minion

Background: I have been working on setting up a salt-environment, and reached the point where I want to distribute not only files, but also directories. I've found that the most sensible way to do ...
7
votes
1answer
4k views

Salt: Minion did not return but salt-call is working

I am working with SaltStack on Windows minions (Linux master). I have written a simple .sls file which copies a hello-world.txt at C:/hello_world.txt. I have also written my top.sls and configure my ...
0
votes
0answers
319 views

What is {{ self }} in Jinja2 templating system

On the SaltStack documentation: It is explained that: 'node_type:web': - match: grain - webserver 'node_type:postgres': - match: grain - database 'node_type:redis': - match: grain - ...