Skip to main content

Questions tagged [salt]

Salt is a Python-based open-source configuration management software and remote execution engine.

Filter by
Sorted by
Tagged with
25 votes
2 answers
16k views

How to examine Jinja output in Saltstack?

I have a templated SLS in Salt I'm trying to build, but it's emitting invalid syntax, which is resulting in errors such as: my-minion-id: - State 'system' in SLS 'network' is not formed as a list ...
Michael Mol's user avatar
  • 1,045
7 votes
2 answers
1k views

Constructing Dependencies from a Pillar in Saltstack

I'm trying to create a dummy state in Salt to pull dependencies from a list derived from a pillar. In my top.sls file, I have: base: '*': - components Then, in components.sls, I have: {% if '...
Michael Mol's user avatar
  • 1,045
6 votes
1 answer
4k views

Check a process is running with Salt Stack?

Is it possible to check if a specific process is running via a Salt State? Looking through Salt Stack documentation and scouring forums I haven't found any way of simply checking if a service is ...
jto's user avatar
  • 378
5 votes
2 answers
29k views

Jenkins Groovy to parse console output and mark build failure

What would be a Groovy or pipeline step to parse Jenkins console output, identify a string and mark the build as failure if the string is matched?
Narasimha's user avatar
5 votes
1 answer
3k views

Securely grab minion ID in pillar top file template?

I found this SLS file in a pillar top.sls targeting example: top.sls: base: '*': - hostspecificsls hostspecificsls: # See https://groups.google.com/forum/#!topic/salt-users/UWfP6bMe6F8 {% ...
Michael Mol's user avatar
  • 1,045
5 votes
1 answer
195 views

Why unable to find the exact path for grains storage in master?

I am trying to completely remove the grains from the system. I have one master and one minion setup(minion id= minion1). I am doing salt minion1 grains.ls that is listing me all the grains Now I ...
Dheeraj Chelaramani's user avatar
5 votes
4 answers
2k views

Yaml linting failling when jinja is used

I am using https://yamllint.readthedocs.io/en/stable/index.html to lint my yaml files (used in a saltstack context, and linted by jenkins jobs at every commit), but as reported and explained here, it ...
Pier's user avatar
  • 344
4 votes
1 answer
48 views

Using requisite injection to order states

Given three states, /root/a, /root/b and /root/c, I want /root/c to execute before /root/b, and /root/b to execute before /root/a. Given a Salt SLS file salt://ordertest/init.sls: /root/a: file....
Michael Mol's user avatar
  • 1,045
4 votes
1 answer
344 views

What is a glob in salt-stack?

I was going through targeting minions in salt. There I came across a term called glob. Can someone explain with an example what is a glob in Salt-Stack?
Dheeraj Chelaramani's user avatar
4 votes
1 answer
206 views

Salt Stack Reporting - Executing commands based on environment

Salt allows users to assign machines to environments by setting in /etc/salt/minion: environment: example You can then execute environments for that state with the command salt '*' state.apply ...
James Shewey's user avatar
  • 3,732
4 votes
1 answer
2k views

Salt Stack environments ignoring saltenv

I have a salt master with four environments configured (base, dev, staging, prod) I am initially trying to set a pillar item to track which envrionment is in use, namely core:env However when I ...
Michael B's user avatar
  • 253
4 votes
1 answer
2k views

How can I share a (global) variable between salt states?

I am using Salt for deployment and configuration management. In order to attach to a FreeIPA server, I need to randomly generate an OTP token and then use it to attach to IPA. How can I share a ...
James Shewey's user avatar
  • 3,732
3 votes
1 answer
845 views

How to insert a minion Powershell variable into Salt Pillar or Mine?

Say I have a Powershell script, named test.ps1, that has this: $VariableForPillar = 5 I can call it from a Salt state with - test powershell run: cmd.run: - name: 'C:\Windows\System32\...
Michael B's user avatar
  • 253
3 votes
1 answer
371 views

Where are dunder dictionaries stored in salt?

I am new to Salt-Stack wanted to know where are all the dunder dictionaries stored? For example __salt__, __opts__, __grains__, __beacons__).
Dheeraj Chelaramani's user avatar
3 votes
1 answer
106 views

SaltStack and Vagrant adding files

I use file.managed to add a file: /home/vagrant/.bash_profile: file.append: - name: /home/vagrant/.bash_profile - source: salt://config/user/.bash_profile - user: vagrant - group: ...
vaggry's user avatar
  • 31
2 votes
3 answers
563 views

Ansible event driven capacity

I've been using SaltStack a lot in my previous job, and loved its event driven model. Now, in my new job, we are using Ansible, and definitely not in an event driven model. I was wondering if there ...
Pier's user avatar
  • 344
2 votes
2 answers
195 views

Set umask for an individual salt state

Is there a way to set the umask for the pip state module or is there a more generic way to set the umask before specific state modules are run? In ansible the pip module takes a umask parameter. I do ...
bdrx's user avatar
  • 141
2 votes
1 answer
7k views

Is it possible to use multiple if statements in a salt state?

I have a Salt state which checks multiple files exist on our webservers, we have 4 webservers and 2 environments so a combined total of 8. This state is applied to all by using a grain 'webserver'. ...
jto's user avatar
  • 378
2 votes
1 answer
787 views

Jinja syntax error: missing endif, in spite of providing it

I am using Salt 2019.2.0 version and below is my state file where I am using if condition to check the values and run states if it's a match. Even if I have provided endif, it says Jinja looking for ...
user22405's user avatar
2 votes
1 answer
240 views

SaltStack Reactor fails with exception

I have the next conf files for salt reactor: reactor.conf 'salt/netapi/hook/cd': /srv/reactor/dev.sls dev.sls # vim: sts=2 ts=2 sw=2 et ai {% set payload = data.get('post') %}...
user54's user avatar
  • 583
2 votes
1 answer
2k views

Is it possible to use a list with 'file.exists' in Salt?

I asked a question recently regarding the most efficient and scalable way to check which files/services exist in multiple environments. Thanks to an answer I have successfully set up roles for all of ...
jto's user avatar
  • 378
2 votes
1 answer
433 views

SaltStack: Use Temporary Scripts And Not Cause State Changes To Reported

I am doing some operations with Kafka via salt, and using scripts to perform them. My current SLS file looks roughly like: /tmp/script.sh: file.managed: - source: salt://blah/blah Run script: ...
ThwompWamp's user avatar
1 vote
1 answer
782 views

Best method of retrieving environment information via Salt Stack?

I have been tasked with using Salt Stack to find out what files/services exist in each of our environments (Test, UAT, Production). The Salt master can speak to all servers in Test and UAT (...
jto's user avatar
  • 378
1 vote
1 answer
537 views

salt-stack: capture group for regex include_pat [closed]

is it possible to have a capture group with include_pat when copying files ? I would like to do something like that: copy_template: file.recurse: - name: '{{ service_path }}\$1' - ...
Dragouf's user avatar
  • 121
1 vote
1 answer
55 views

Salt State is running against all servers except one, why?

I recently asked a question here: Is it possible to use multiple if statements in a salt state? Thanks to the answer I have managed to update my state to only check specific files exist on specific ...
jto's user avatar
  • 378
1 vote
1 answer
265 views

How does one perform systems testing against multiple interdependent machines?

I'm looking for a platform that allows me to run tests against multiple, closely-coupled systems. We deploy different products to Red Hat family machines - think Rocky Linux, CentOS, Fedora, RHEL, etc....
vpseg's user avatar
  • 11
1 vote
2 answers
180 views

Saltstack howto create a Concatenation CA?

I would like to have the following a bit more clean. I'm trying to create concatenated CA file using Salt. To accomplish this I first have to collect all glusterfs.pem files from all my minions and ...
V O's user avatar
  • 111
1 vote
1 answer
84 views

Why is IF failing with satl state file from Jenkins?

I invoke a saltstack state file "init.sls" from a Jenkins pipeline as below. If job == Yes, it is expected to execute test_command and test_final, else if job == No, it must execute test2_command and ...
Narasimha's user avatar
1 vote
1 answer
453 views

How to assign saltstack pillar values from Jenkins comma separated input parameters?

I have a Jenkins job with string parameter as target "server1,server2". Jenkins pipeline script is expected to execute the job on server1 and server2 respectively. There is a common salt sls file that ...
Narasimha's user avatar
1 vote
1 answer
2k 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 %} {%- ...
BlackBishop's user avatar
1 vote
1 answer
150 views

How to add multiple jvm options in a saltstack jinja?

I have a config.jinja file with below jvm options: `-Dappdynamics.agent.appName=AP_{{ pillar['region'] }}` However the AP_{{ pillar['region'] }} varies for different environments. For Dev/Prod it ...
Narasimha's user avatar
1 vote
1 answer
2k views

SaltStack states pattern and replace for multiple files under directory and for multiple line matches

I am using saltstack state pattern and replace to match a pattern and replace with a new pattern. My init.sls file executes below: `modify_script.sh: file.replace: - name: /path/to/script.sh ...
Narasimha's user avatar
1 vote
1 answer
225 views

How to create AWS application load balancer using saltstack

I was trying to create application load balancer with salt stack. I am using salt boto_elbv2 which is having option to create target groups but dont have option to create load balancer, how can i ...
user1340004's user avatar
1 vote
1 answer
210 views

saltstack: archive.extracted template jinja

I have an archive on my master and want to extract it on the minion. For this it is fine I use : archive.extracted: - name: 'c:\PACKAGE' - source: salt://myfile.zip - archive_format: ...
Dragouf's user avatar
  • 121
1 vote
1 answer
445 views

How can I pass a secret from a Salt Master to a Minion without using a Pillar?

I am looking to understand how I can reduce duplication of secrets. For example SSL Certificates. I want to have the Salt Master pull the Certificate from a Secure Source (Azure Key Vault) and then '...
Steven K7FAQ's user avatar
0 votes
1 answer
2k views

Salt - Need state to check pillar and perform a if/else check

This is salt 101 I think, but I'm really a salt N00b and need assistance. I need to disable specific services on all of our servers by default, but I need to create a pillar that allows me to override ...
Egyas's user avatar
  • 1
0 votes
1 answer
83 views

In salt what causes the WARNING 'version' argument will be ignored for multiple package targets

For some of my pkg.installed states I get this warning [INFO ] Executing state pkg.installed for [install haproxy package] [WARNING ] 'version' argument will be ignored for multiple package ...
bdrx's user avatar
  • 141
0 votes
1 answer
196 views

gitlab -ci script not being updated on runner

I have a problem I can't get my head around in gitlab-ci: I have a monorepo where I store some infra code (IaC), in this repo I have a script which allow me to lint the saltstack states code, as : #!/...
Pier's user avatar
  • 344