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.

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

Deliver unique file for each Salt minion

There is some directory path, like /etc/opt/mysoft which contents should be different for each minion. So for minion A it contains config.ini with come contents and for minion B it contains config....
1
vote
1answer
81 views

Saltstack - need to get some info from a minion scheduled event

I've got a minion scheduled event (/etc/salt/minion.d/_schedule.conf) which runs a particular state file using the state.sls function. I've got jid_include and return_job set to "true". I know the ...
1
vote
1answer
89 views

Force rebuild of a minion's state?

TL;DR I have begun controlling all my virtual machines using Saltstack. I have set up two separate environments, init and base, for installing the minion on a freshly deployed VM and ongoing ...
1
vote
1answer
48 views

Saltstack: deploy EC2 instances in several availability zones

Just started learning Saltstack to control the infrastructure at AWS. We are developing an application to which time is really important, so we need to deploy from the beginning, a distributed ...
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 ...
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....
1
vote
1answer
75 views

Stormpath and saltstack

Does anyone use stormpath to authenticate against user/password with saltstack? Instead of creating new users and/or getting it from db, I was wondering if someone is using stormpath to get the data(...
0
votes
1answer
23 views

Saltstack: How to install a new zypper RPM Repo?

How to add a new rpm package repo via saltstack? I checked the docs, and only see method to list, modify or delete repos: https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.zypper....
0
votes
1answer
41 views

Salt: Raise Error if file.replace did not find anything to replace

Maybe I am blind, but I could not find a way to let the salt-ssh call fail, if file.replace did not replace a single line. If the pattern I provide did not match, then I want to get noticed. Example:...
0
votes
1answer
109 views

Jinja “for loop” statement with multiple lines (saltstack)

When using salt for specifying user creation, it is unorganized to have the for statement in a single line. Example: {% for USR in 'hewey','dewey','loui' %} Is it possible to break this into ...
0
votes
1answer
92 views

How to instal vim using salt stack?

I have salt-stack maser and minion servers which running on centos7. I want to install vim package in minion server. For that I have created srv directory and vim.sls file under etc. My vim.sls file ...
0
votes
1answer
22 views

.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 ...
0
votes
1answer
120 views

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 '...
0
votes
1answer
239 views

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: "{{ ...
0
votes
1answer
45 views

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 ...
0
votes
1answer
137 views

SaltStack: from 1 blockreplace to N blockreplace

Introduction Up to now we created one block in the /etc/sudoers file with N entries. This is not a good solution, since sometimes we only want to update one system and give explicit pillar data. ...
0
votes
1answer
78 views

Can we remove dependencies when we change a state of a node in Salt?

I wonder to know if it is possible to install and remove packages when we change a state of node? To clarify what I mean here is an example: Groups: Load balancer Web server Database Nodes: Minion1 ...
0
votes
1answer
82 views

When saltstack compacts output, how do you call that? Can you turn compacting off?

When you have deep nested output data in salt, you will sometimes see that some levels get compacted, like the example below. And this compact format with the pipe delimiter is already in the output ...
0
votes
1answer
251 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: -...
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 "<...
0
votes
1answer
508 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 ...
0
votes
1answer
954 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 ...
0
votes
1answer
135 views

Why I am getting multiple responses from salt-minions?

I got the first response of all minions in valid json string but then I am getting three another different responses from same minions which are invalid json strings. root@localhost:/home/i-kod/...
0
votes
1answer
645 views

Installing packages inside a docker container using saltstack

Ive have been looking for tutorials to help me understand it but my searches has been unsuccessful. so I was wondering if it is possible for a Saltstack Master to install packages, say apache-mysql-...
0
votes
1answer
1k views

Saltstack - Error - No Top file or external nodes data matches found

I'm trying to configure my Saltstack Architecture. I followed all the steps, but It seems not working and I'm not able to find the problem. /etc/salt/master file_roots: base: - /srv/salt dev: - /...
2
votes
0answers
107 views

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/...
2
votes
0answers
111 views

Saltstack: how to configure a state that need a service running then restart this service

I try to configure a software, by sending a command to its running service. However, to apply the new configuration, the service needs to be restarted. How can I do that? I tried: appsrv: service....
2
votes
0answers
124 views

salt pkg.upgrade misses some updates

If I execute apt upgrade several packages will be found: # apt upgrade The following NEW packages will be installed: linux-headers-4.4.0-109 linux-headers-4.4.0-109-generic linux-image-4.4.0-109-...
2
votes
0answers
465 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
2
votes
0answers
564 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, ...
1
vote
0answers
283 views

GitFS Salt Environments with a single top.sls

The documentation states that if you use salt_top_saltenv: base in the master config, that I can force all Minions to only use the base saltenv for the top file, ignoring all other top files, is ...
1
vote
0answers
44 views

Any way to run a vim session over salt-ssh?

Anyone know of a way to interact with the console/terminal over a salt-ssh command? I'm trying to run vim to change the subnet and FQDN for about 70 hosts. I could use sed and company but wondering if ...
1
vote
0answers
87 views

Disabling ECN: Netsh: incorrect paramater when executing via SaltStack cmd.run

I'm attempting to mass disable Explicit Network Congestion Notification on a group of Windows Server 2012r2 servers hosted in AWS EC2. I'm using the Salt Stack configuration management tool. When I ...
1
vote
0answers
633 views

Service monitoring through salt reactor and beacon

I try to monitor the service through salt reactor and beacon. If event happens (eg: nginx service stop on one minion), need to write it to a file in salt master. I have no idea how to call the event ...
1
vote
0answers
82 views

Run haproxy.disable_server when haproxy runs as multiple processes

We have few application server and 2 load-balanders (HAProxy). Cloud in implemented with SaltStack. When there is need to disable certain app server, we log into salt master and run: for i in {1..20};...
0
votes
0answers
21 views

Unable to run sync_grains while using grain matching

Whenever I try to run the sync_grains command on a host using glob matching, it works great: root@salt:~# salt '*-stage-*' saltutil.sync_grains; echo $? i-0bbaf106121397b74-stage-knowledge-base: 0 ...
0
votes
0answers
59 views

Passing a variable into Salt cmd.script module?

I have a PowerShell script that finds what version of Java is installed by checking the registry but the script has Java hard coded into it and I would like to be able to change it to Adobe, or Google ...
0
votes
0answers
37 views

Saltstack Jinja template pillar merge

I have a several pillars and I am trying to merge them in the same jinja variable {%- import_yaml "server_list_de.yaml" as servers %} {%- import_yaml "server_list_uk.yaml" as servers_uk %} {%- ...
0
votes
0answers
36 views

SaltStack: Requisite not found

I try to configure sqreen. I installed the pkg, sqreen-repo: cmd.run: - name: curl -s {{ sqreenScriptUrl }} | sudo bash - unless: test -f /etc/apt/sources.list.d/sqreen_sqreen.list - ...
0
votes
0answers
64 views

clone VM via SaltStack

I try to clone the virtual machine: ubuntu-template: provider: vcenter01 clonefrom: Ununtu1804 host: 192.168.1.6 and got: Error creating newvm1: A specified parameter was not correct: ...
0
votes
0answers
40 views

Salt: Better error message if pre-condition failed

If this condition is true: ~postgres/data/postgres.conf exists and ~postgres/data/base/ does not exist then I want to write out an error message. I call above a "pre-condition" check. This state ...
0
votes
0answers
51 views

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 ...
0
votes
0answers
41 views

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 ...
0
votes
0answers
240 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 ...
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 - ...
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 ...