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.

0
votes
2answers
134 views

Automate PostgreSQL Upgrade

Our manual recipe to do a PostgreSQL version upgrade (example from 9.6 to 10.1) looks like this at the moment: stop DB (via systemctl) start DB on a different port pg_dumpall using the different port ...
0
votes
2answers
2k views

SaltStack: Do x if /var/log/backup exists

I want to execute this state: backup_log_readable: acl.present: - name: /var/log/backup - acl_type: user - acl_name: monitor - perms: rx - recurse: True But this should happen ...
2
votes
2answers
151 views

Shutdown Cron during execution of SaltStack

If we update our systems with SaltStack this takes about 40 seconds. During these 40 seconds the state of the system is not consistent. If there are cron jobs which start during this period, it is ...
2
votes
1answer
6k views

SaltStack | How to assign the shell output from cmd.run to Jinja variable?

Problem Unable to assign the output from cmd.run in my Salt State. The condition always return true even if the load_avg in the minion is not really equal or beyond the threshold. I also included in ...
1
vote
1answer
156 views

SaltStack: Change linux ACLs for /home/*/input/

There are roughly 30 users and 30 directories with this structure on a SaltStack minion: /home/user1/input/ /home/user2/input/ /home/user3/input/ /home/user4/input/ ... I know how to change the ...
1
vote
2answers
537 views

Count the number of Salt minions matched

Is there a simple way to count the number of minions returned by a match, for example: salt -C 'G@ec2_roles:test' match.count
1
vote
1answer
562 views

Can salt-call grains.get display only the value of the key?

salt-call grains.get cluster local: up102 Is there a way for salt-call to display only the value (eg. up102) without the rest of the output, or must I resort to using awk or jq etc to extract it?...
0
votes
1answer
494 views

Select a Salt top file when using saltenv with a gitfs backend

Background I have a Salt instance configured with a gitfs backend. By default, this specifies the master branch to be the base environment. So, when I execute: salt <minion-id> state.apply ...
0
votes
2answers
487 views

How can I make salt-api return more useful data?

salt-master: 2016.11.5 (Carbon) salt-api: 2016.11.5 (Carbon) salt-minion 2016.11.5 (Carbon) cherrypy: 10.2.2 After setting up salt-api using this tutorial I've been able to successfully use the API ...
0
votes
1answer
238 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 ...
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
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
1answer
953 views

Passing jinja variable to script from salt pillar

Using salt to provision and I want to be able to run cmd.script. The script works if i list all packages i intend to install within the script. But i will prefer to have the list of packages in salt ...
1
vote
1answer
185 views

Which SaltStack returners work properly with master_job_cache?

I've been working to set up an external returner on the master side for my Saltstack deployment -- a 'master_job_cache', as specified in the documentation. I started with Slack and mongo_return. I ...
1
vote
1answer
531 views

Saltstack: How can I control the output of cmd.run?

I am only using Saltstack to run commands on multiple servers, e.g. to check if a specific TYPO3 extension exists on any server. I want to suppress empty output of minions (i.e. the hostname) and want ...
1
vote
2answers
506 views

Fedora Server 25 firewall issue. Ports 22, 80, 443 blocked at each boot, have to stop firewalld

I setup Fedora Server 25 in a VM and used SaltStack to install NextCloud via this walk-thru. The issue I am having is the firewall is too restrictive and is blocking ports 22, 80 and 443. Per the walk-...
0
votes
1answer
52 views

Move $HOME of user postgres from /var/lib to /home via SaltStack

I want to move $HOME of user postgres from /var/lib to /home via SaltStack. Here are the steps which happen before: postgres RPM gets installed $HOME is /var/lib Database gets initialized In this ...
1
vote
1answer
78 views

questions to tag volumes by salt, either state or module?

How salt can tag ec2 ebs volumes? I have tried all different ways I could think of, but non of them working: First, tag volumes in profile: block_device_mappings: - DeviceName: /dev/sdb ...
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 ...
2
votes
3answers
3k views

How can you make a salt execution module return a nonzero exit code on failure

I'm trying to use Jenkins to run a Salt execution module command; if any minion fails to execute the command, I want the Jenkins job to fail. Jenkins just follows the general shell scripting practice ...
0
votes
1answer
615 views

Salt-Stack : Pillar passed in state files

I have a slight confusion in relation to passing pillar across state files. I am using an Orchestrator to orchestrate running states on two vms (example vm1 and vm2). These states have no dependency ...
0
votes
2answers
241 views

Validate configuration changes via salt

Background: recently I discovered an issue on our servers where zookeeper wouldn't start on one of them. It was caused by the myid file being empty (it requires a number). Executing salt didn't fix ...
0
votes
1answer
136 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. ...
2
votes
1answer
487 views

Saltstack rpm package install fails

So i got these errors while run salt -G 'os:centos' state.apply ---------- ID: filebeat Function: pkg.installed Result: False Comment: An exception occurred in this state: Traceback (most ...
0
votes
1answer
492 views

Why can't I use Digital Ocean private IPs for reverse proxying with this Salt Cloud setup?

I'm following along with this DigitalOcean tutorial that lays out how Salt Cloud works, with two app servers and a reverse proxy. The expected result near the end is that you should have a pure JS app ...
2
votes
1answer
505 views

Change SSH Port Using Saltstack

I have a server with a "standalone" minion installed and configured. I've been able to make lots of changes to my server with salt but I can't figure out how to configure my ssh server. Here's what I ...
0
votes
1answer
119 views

Salt virt - how to add additional volume

I have read about disk profiles for salt-virt. I have created a disk profile accordingly. virt.disk: default: - system: size: 8192 kmaster: - system: size: 40000 knode: ...
1
vote
1answer
333 views

SaltStack: /etc/sudo: /bin/systemctl vs /usr/bin/systemctl

We use SaltStack for configuration management since some weeks. How to handle the distribution specific location of systemctl? On Ubuntu: /bin/systemctl On SuSE: /usr/bin/systemctl At the moment I ...
2
votes
3answers
199 views

Do any configuration management systems explicitly support config changes made directly on a server?

In general (as far as I can see) the main infrastructure/configuration management systems (Puppet, Chef, Ansible, and SaltStack) are based on the philosophy that your servers are "cattle" and not "...
1
vote
1answer
609 views

SaltStack: NamespacedDictWrapper object has no attribute

I get this message, and I have no clue why salt:/srv # salt-ssh foo-archiv state.sls monitoring [ERROR ] Rendering exception occurred: Jinja variable 'salt.utils.context.NamespacedDictWrapper ...
1
vote
0answers
632 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};...
3
votes
2answers
2k views

SaltStack: How to work around “file.recurse doesn't preserve permissions”?

How to work around Recursive directory management doesn't preserve permissions? I want to copy all files in (local) /monitoring/files/etc to /etc on the minion. copy_files_in_etc: file.recurse: ...
4
votes
2answers
982 views

Salt top.sls does not update on `salt-run fileserver.update` with gitfs

I have a single salt minion connected to the salt master. I recently renamed a large .sls from 'webserver.sls' to 'jetty.sls'. I use a gitfs backend with pygit2 and ssh. I have only enabled the gitfs ...
3
votes
1answer
1k views

Moving Salt Master to a new server

So I am tasked with migrating some servers into AWS. One of the servers is a Salt Master. Upon investigation, all Salt Minions connect to the Master using DNS name instead of IP Address, so from ...
0
votes
2answers
233 views

How to create a salt stack manifest from an existing machine

We recently lost our system admin. and I have picked up the task of ensuring that if anything bad happens we can recreate our VM's. The systems are FreeBSD various versions. Is there any way i ...
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 ...
1
vote
1answer
633 views

SaltStack: How to implement custom Jinja Filter?

I want to extend the jinja filters which are avaiable in SaltStack I want to create a simple filter called rpm_to_debian_name { package-name | rpm_to_debian_name } I only found docs about the salt ...
-1
votes
1answer
1k views

SaltStack: create ssh keypair and add it to authorized_keys

Goal For testing, we want this to work: ssh $USER@localhost. create rsa keypair in ~/.ssh/, if not already there add .ssh/id_rsa.pub to .ssh/authorized_keys, if not already in this file. Question ...
2
votes
1answer
432 views

What is the equivalent of Puppetforge and Ansible galaxy for Salt?

What is the equivalent of Puppetforge and Ansible galaxy for Salt? I have read this website, but could not find the equivalent.
7
votes
3answers
2k views

SaltStack: Is there a way to only display failed and warnings in output?

Running state.apply or state.highstate on minions can result in hundreds of lines in output. Sometimes only one minion can be enough. ... Summary for my_minion -------------- Succeeded: 112 (changed=...
2
votes
1answer
158 views

salt-cloud & Rackspace: How to attach Private Networks to new instances?

I'm trying really hard to get salt-cloud to provision new servers with one (or more) private networks attached. SaltStack's documentation here said that I am supposed to add this "section" to the '...
1
vote
1answer
209 views

RabbitMQ cluster restarts every 30 minutes

I have a two node RabbitMQ 3.6.1 cluster (on CentOS 6.8 in AWS) that seems to restart regularly every 30 minutes. I just traced through the logs (/var/log/rabbitmq/rabbit@<hostname>.log) on both ...
1
vote
1answer
432 views

SaltStack: Which firewall rule for outgoing traffic on minions?

On a network where all OUTPUT ports are closed by default on minion servers, and only required ports are opened, which ports do I have to open on the minion servers for the communication between the ...
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
237 views

SaltStack - iptables icmp rule doesn't work

System: Debian GNU/Linux 8.6 (jessie) salt-master 2016.3.3 (Boron) salt-minion 2016.3.3 (Boron) Trying to add an icmp rule will result in an error message. init.sls INPUT: iptables.chain_present:...
2
votes
4answers
115 views

Configuration Management tools failover behaviour

I'm currently trying to sell "DevOps" to my management one of the things I'm investigating is Configuration Management tooling. One of the big things for us is that we have a system that has high ...
0
votes
1answer
353 views

How to proxy SaltStack behind Nginx

By default, when installed, Saltstack uses port 4505 and 4506 to connect with Minions. But I can't open port 4505 and 4506 on Salt master server. Is there any way we can configure Salt master behind ...
2
votes
1answer
865 views

Building an AMI using Packer with a shell provisioner

I'm trying to create an AMI (based on ubuntu; ami-2d39803a) that I can reuse for a project with the a set of components installed. I'm using packer to achieve this with a shell script that gets ...