Questions tagged [salt]

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

38 questions
25
votes
2 answers

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 In principle, it should be possible to, somehow…
Michael Mol
  • 1,045
  • 1
  • 8
  • 19
7
votes
2 answers

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 'components' in pillar.items() %} include: {% for…
Michael Mol
  • 1,045
  • 1
  • 8
  • 19
6
votes
1 answer

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 running and reporting the output. I have however found…
jto
  • 378
  • 1
  • 6
  • 19
5
votes
2 answers

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
  • 89
  • 1
  • 1
  • 8
5
votes
1 answer

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 removed data.p which is the cache memory for the…
5
votes
4 answers

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 is not possible to validate a yaml file in which…
Pier
  • 344
  • 4
  • 16
5
votes
1 answer

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 {% include 'hosts/' + salt['grains.get']('fqdn') + '.sls'…
Michael Mol
  • 1,045
  • 1
  • 8
  • 19
4
votes
1 answer

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.managed: - source: salt://ordertest/a - user:…
Michael Mol
  • 1,045
  • 1
  • 8
  • 19
4
votes
1 answer

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?
4
votes
1 answer

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 saltenv=example However, it appears that the same…
James Shewey
  • 3,752
  • 1
  • 17
  • 38
4
votes
1 answer

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 try to switch environments using the following…
Michael B
  • 253
  • 1
  • 7
4
votes
1 answer

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 variable between SLS files? For example, init.sls: {%-…
James Shewey
  • 3,752
  • 1
  • 17
  • 38
3
votes
1 answer

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__).
3
votes
1 answer

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: vagrant - template: jinja - mode: 0775 …
vaggry
  • 31
  • 1
3
votes
1 answer

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\WindowsPowershell\v1.0\powershell.exe -ExecutionPolicy…
Michael B
  • 253
  • 1
  • 7
1
2 3