Questions tagged [saltstack]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
34 views

SaltStack: install packages behind proxy

Getting through a Saltstack tutorial and ran into a problem how to install packages on a linux host if it's behind a proxy. For example, I have a file nettools.sls: install_network_packages: pkg....
0
votes
0answers
10 views

using salt states lvm

https://docs.saltstack.com/en/master/ref/states/all/salt.states.lvm.html Is it a good practice in the first place? How reliable is it? Let's say I have partition with important data. Can I create PV, ...
0
votes
2answers
78 views

Open SSL throwing unknown option '-n' in Amazon Linux2 instance

My code throws error when it reaches this line: {% set encrypted_password = salt['cmd.run']('openssl enc -aes-128-cbc -a -salt -md md5 -in <(echo -n "' + ssm_plaintext_password +'") -pass pass:'+...
0
votes
0answers
8 views

Salt Virt - source_file argument not working

I have the following state file: TEST-VM: module.run: - name: virt.init - m_name: TEST-VM - cpu: 2 - mem: 4 - disk: None - disks: - m_name: TEST-VM format: ...
1
vote
1answer
63 views

saltstack: Pass jinja variable from a salt state file to an included salt state

I have the case where I have 3 salt states A.sls, B.sls and C.sls of which only one will be applied on a host. All 3 of them sets a jinja variable x to a specific value and then I want all 3 to call ...
0
votes
0answers
20 views

Updating roots fileserver cache in salt stack is taking to long

Every time I execute SaltStack it stucks on the this part for more than two minutes: [DEBUG] Updating roots fileserver cache The rest of salt is executed very fast. Is maybe reason large /srv/...
0
votes
1answer
62 views

Saltstack: Select data from database using salt

I want to select data from a database table (here mysql) with saltstack. In my test scenario I have a linux host called salt-master. On this host the database, the master and the minion are running. ...
0
votes
1answer
33 views

Can ext_pillar be configured depending on pillarenv or saltenv?

I'm looking for a way to select the external pillar depending on saltenv or pillarenv variable. From saltstack documentation, ext_pillar does not support the same syntax as pillar_roots (https://docs....
1
vote
1answer
81 views

Salt configuration for nftables prerouting

I'm trying to configure a nftables-rule for forwarding traffic from my server to a LXC container, however, the way that the salt states module for dport renders the given value is not accepted by ...
1
vote
1answer
141 views

SaltStack: Delete directory, if it is empty

How can I delete a directory with SaltStack, if it is empty? First I remove a file in this directory, and then I would like to delete the directory. But if there is one or several files in the ...
0
votes
0answers
26 views

symlink issue with saltstack pillar data

I'm working with an inherited system where AWS infrastructure is currently being managed via Terraform and Salt, with pillar data stored in a remote git repo. In the original repo I can see the team ...
0
votes
0answers
19 views

SaltStack disable local windows Administrator if it is enabled

I'd like to disable the built-in windows local administrator account if it is enabled. As salt.state.user.present doesn't support disabling accounts, I'm using salt.modules.win_useradd.update. ...
0
votes
0answers
17 views

OpenLDAP users can look up their own group memberhips

We have an OpenLDAP server that we've been using for allowing users to log into various nix machines so long as the ldap client is installed on that machine. Recently we decided to try and use ...
0
votes
2answers
1k views

How to install salt for python3?

When I check my salt-minion version, I get the following message: [root@localhost ~]# salt-minion --version /usr/lib/python2.7/site-packages/salt/scripts.py:198: DeprecationWarning: Python 2.7 will ...
0
votes
1answer
123 views

SaltStack: No usable error message if dpkg fails

I get this message from salt-ssh ID: apache Function: pkg.installed Result: False Comment: Problem encountered installing package(s). Additional info follows: errors: ...
0
votes
1answer
51 views

Call state directly via salt-ssh

Is it possible to call this state via salt-ssh directly? vim: pkg.installed I mean without creating an sls file?
0
votes
0answers
11 views

SaltStack + SaltCloud, dynamically allow incoming minion IPs for master

What I want to do is to create new VMs with SaltCloud, but as a part of VM creation allow IP address of newly created VM on SaltStack Master host firewall almost instantly, so before VM boots and runs ...
0
votes
1answer
127 views

Loop through salt pillar to create file without knowing keys

Background: I need to make an XML file like this: <?xml version="1.0"?> <configuration> <appSettings> <add key="BaseOU" value="DC=myplace,DC=wan" /> <add key="...
0
votes
0answers
21 views

SaltStack Master installation

I want to install the SaltStack master on my Debian 9 physical machine. I added the line deb https://repo.saltstack.com/apt/debian/9/amd64/latest/ stretch main in the sources.list file and added the ...
0
votes
0answers
193 views

Set variable from cmd.run in jinja + saltstack on Windows Minion

I am trying to set a variable in jinja when a task in task scheduler is found on the Windows Minion. Tried many things but dont seem to get this working yet. here is the code that I have {% set ...
0
votes
0answers
180 views

Package/patch management with Salt

I am setting up saltstack to manage workstations. Linux, Windows and MacOS. I want to distribute, install and manage software with saltstack. What would be the best way to achieve this using saltstack?...
0
votes
0answers
52 views

Is it possible to use Jinja in a SLS file and create a dependency relation with other states?

I have an interesting problem to solve using SaltStack 2016.3. I need to set a Jinja variable to collect some runtime parameters in the minion, but the problem is that these parameters depend on the ...
0
votes
2answers
486 views

SaltStack: found conflicting ID

My sls file: /etc/sudoers.d/foo: file.managed: - contents: | foo ALL = NOPASSWD: /usr/bin/systemctl restart minio_storage-foo.service foo ALL = NOPASSWD: /bin/systemctl restart ...
3
votes
1answer
2k views

Unable to generate GPG keys without passphrase on Ubuntu 18.04 [closed]

Has anyone tried creating GPG keys for encrypted pillars on Ubuntu 18.04? I'm using the following command to attempt to generate the keys: gpg --gen-key --homedir /etc/salt/gpgkeys When I run that ...
0
votes
1answer
25 views

Salt-Stack init process after package is installed

Installing AIDE needs to follow by a init proces. aide: pkg: - installed Now the following commands need to run only once: /usr/sbin/aide --config=/etc/aide.conf --init mv -f /var/lib/aide/aide.db....
0
votes
1answer
36 views

SaltStack: normalize Package name

I would like to have less conditions in my saltstack sls files. Up to now it looks like this: foo_package: pkg.installed: - pkgs: {% if grains.os_family == 'Debian' %} - foo_BAR {% ...
0
votes
2answers
45 views

saltstack equivalent of puppet last_run_summary.yaml

Does Salt have the equivalent of Puppet's last_run_summary.yaml? If not, what's the suggested way to monitor the success or failure of executions on individual salt minions?
0
votes
1answer
89 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
69 views

Saltstack formulas (starter)

Is any saltstack formula 'skeleton' available so it can create a structure as described here? In chef you have knife cookbook create or in ansible ansible-galaxy init.
0
votes
1answer
180 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
246 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
2answers
363 views

Salt: file.replace on a list of files (globbing)

I use file.replace and would like to use this not on a single file, but on a list of files. The list of files comes from globbing. Example: I want to modify /etc/ImageMagick*/policy.xml. The file ...
0
votes
1answer
135 views

Salt: file.replace: ignore_if_missing gets ignored?

I want to enable logging of an fstp server like this: https://serverfault.com/a/74234/90324 But salt does nothing. I reduced it to this: enable_logging_of_sftp: file.replace: - name: /etc/ssh/...
2
votes
2answers
4k views

How to copy file from master to minions on salt-stack?

I want to copy a file from salt stack master server to minion servers. I found a script from https://stackoverflow.com/questions/27687886/copy-a-file-from-salt-master-to-minions. But I got an error. ...
0
votes
1answer
242 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 ...
1
vote
1answer
475 views

Automatic pillars by host name

I have problem where managing multiple domains in one top.sls file is getting difficult. How could I write top.sls so that it only takes those pillars that match my minion name/hostname. For example:...
0
votes
1answer
368 views

Salt Stack file.recurse Recurse Failed

I built a state file in salt to copy a list of check_mk Nagios scripts down to the remote server. Below is a snip of the state file. check_mk_defined_checks: file.recurse: - name: /usr/lib/...
0
votes
2answers
282 views

Saltstack state.apply determine whether it is being run in test=True mode ?

We are using serverdensity (BETA MODULE - https://docs.saltstack.com/en/latest/ref/states/all/salt.states.serverdensity_device.html) with salt and have hit the (bug?) where if you try a : salt '*...
0
votes
1answer
29 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 ...
1
vote
1answer
99 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
2answers
742 views

Executing arbitrary sls file with salt

I'm learning about salt. I understand that the way things work, state files must be put under a root directory specified statically in the master/minion config. So my question is, is there a way to ...
0
votes
1answer
82 views

SaltStack: Disable Cron during run

I would like to disable cron on the minion when salt gets executed. Disabling it would be easy: service.disabled But how to enable it again (in all cases (success or error))? What I want is ...
2
votes
0answers
622 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 ...
2
votes
0answers
224 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/...
3
votes
1answer
2k views

How to reposync saltstack? reposync failing with error message `Removing […], due to missing GPG key.`

On a RHEL 7.4 system, I add the salt-latest repo as follows: yum -y install https://repo.saltstack.com/yum/redhat/salt-repo-latest-2.el7.noarch.rpm Notice, amongst other things, this creates the ...
1
vote
1answer
489 views

SaltStack: How to create user and a directory in his HOME directory?

I want to create a user and a directory in his HOME directory. Unfortunately the HOME directory is not allways directly under /home. On some minions it is under /localhome and some use /users/.
1
vote
1answer
1k views

Saltstack and Python3 issue

I'm having a bit of an issue with the following recipe: setup-compose: file.managed: - source: https://github.com/docker/compose/releases/download/1.21.1/docker-compose-Linux-{{ grains['cpuarch'...
0
votes
1answer
129 views

salt-ssh Do changes which spans several hosts

I need to change two hosts: A new web-server gets configured A tunnel between tunnel-host and the new web-server should get created We implemented both, and both steps work: root@s# salt-ssh ...
0
votes
0answers
58 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
1answer
497 views

SaltStack: ImportError: No module named backports.ssl_match_hostname

I get this exception: ===> salt-ssh remote-host cmd.run 'id' remote-host: ---------- retcode: 0 stderr: Traceback (most recent call last): File "/var/tmp/....

1
2 3 4 5 6