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 [salt]

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

0
votes
1answer
8 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 ...
1
vote
1answer
38 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
1answer
15 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 ...
1
vote
0answers
25 views

How to match a pattern and replace all files in a directory using salt states?

Salt stack state to recursively loop over a directory without explicitly specifying file names. Added single and multiple quotes, that didn't help. I don't wish to specify each file for a file replace....
0
votes
1answer
70 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 ...
0
votes
0answers
27 views

Execute shell with multiple arguments using saltstack

I am expected to execute the shell script with multiple arguments using saltstack: /opt/jboss/bin/cli.sh --connect --controller=localhost:9999 /server-group=G_bc2:stop-servers To achieve the above, i ...
1
vote
0answers
41 views

Pass Variable in pipeline script

I am trying to pass a variable input to "credentialsId: $creds" from SiteID but unable to. I tried multiple expressions in pipeline script with quotes etc and none worked. I am learning and need ...
3
votes
1answer
1k 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?
0
votes
0answers
45 views

How to communicate between two manged nodes without control nodes in Ansible?

I am new to Ansible. In salt using salt-call, we can communicate between two minions. Similarly, I wanted to know how in Ansible can one Managed node talk to another Managed node without using the ...
4
votes
1answer
41 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?
2
votes
1answer
66 views

Where are dunder dictionaries stored in salt?

I am new to Salt-Stack wanted to know where are all the dunder dictionaries stored(Ex:salt,opts,grains,beacons etc). Thanks in Advance :)
1
vote
1answer
50 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 ...
3
votes
1answer
41 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 ...
1
vote
3answers
181 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 ...
1
vote
1answer
61 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: ...
1
vote
1answer
122 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' - ...
1
vote
0answers
25 views

Ensure that reactor worked out and see the result of execution state in SaltStack

Is there a way to get a progress of working out of saltstack reactor in realtime via API after sending event to reactor via API request? For now, the single output which is possible to see is {"...
2
votes
1answer
72 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') %}...
1
vote
1answer
37 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 ...
2
votes
1answer
2k 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'. ...
5
votes
1answer
987 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 ...
2
votes
1answer
181 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 ...
1
vote
1answer
135 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 (...
2
votes
1answer
110 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: ...
4
votes
1answer
169 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 ...
5
votes
1answer
1k 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 {% ...
4
votes
1answer
772 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 ...
3
votes
1answer
51 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: ...
3
votes
1answer
685 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 ...
14
votes
2answers
6k 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 ...
3
votes
1answer
237 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\...
4
votes
1answer
47 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....
7
votes
2answers
462 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 '...