Questions tagged [salt-stack]
The Salt Project, previously known as SaltStack, is a Python-based open-source configuration management software and remote execution engine.
1,348
questions
0
votes
0
answers
8
views
saltstack trying to update php.ini file
I am quite new to salt, but I am trying to update our PHP.ini file. Specifically I want to populate the timezone field:
[Date]
; Defines the default timezone used by the date functions
; http://php....
0
votes
1
answer
10
views
Replace text using saltstack
I will need your assistance on the following:
I would like to replace an IP address within a file, regex is matching, but the output is totally wrong.
test.sls
wsc_start_server:
file.managed:
- ...
0
votes
1
answer
35
views
Ignoring a specific undefined variable with pyright
When writing custom SaltStack modules/states using VScode and linting with pyright, I get the following error all over the place:
"__salt__" is not defined
It's not a killer, because I can ...
-2
votes
0
answers
26
views
Reactor is not triggering event - Saltstack
We have created fully integration communication between vCF & Saltstack config.
Which means that building an VM from vCF platform and executing an event after the workstation wakes up and salt-...
0
votes
0
answers
17
views
Need to get information using salt['mine.get'] on a XML file in the minion using xml.get_value module
{% set value = salt['mine.get']('{{ server }}', 'xml.set_value')('/opt/suite/version.xml', './/Version']) %}
Get value:
cmd.run:
- name: echo {{ value }}
Need help in writing the set value.
0
votes
0
answers
26
views
Reactor - vRA - Saltstack Config integration
Assumption
vRA to Saltstack config integration is working fine
Saltstack config accepting the keys from the minion
I am triggering an event from vRA when I am creating a new VM. I would like to know ...
0
votes
0
answers
25
views
How can I use salt-mine when using salt-ssh
I have a saltstack state which requires accessing the salt mine for it to execute correctly. This has been working fine, but we have recently switched to using salt-ssh and it is producing the ...
0
votes
0
answers
45
views
end_date (str) - how can I add another function like "cmd.run: date" to end_date module function to get the actual date?
This is my command below and it says "true" but doesn't work.
end_date=cmd.run 'echo %date:~10,4%/%date:~4,2%/%date:~7,2%'
0
votes
1
answer
50
views
Saltstack -> 'Pillar failed to render with the following messages'
On my FreeBSD I have a file packages.sls in the following path /usr/local/etc/salt/states
I'm getting the following error message when i do salt '*' state.apply packages :
freebsd:
Data failed to ...
1
vote
1
answer
35
views
How to force a salt state with onchanges based on a state in the 'include' section
I want to restart a service (haproxy) on a machine based on changes executed on another state. This would tipically be easy with onchanges but I have a particular case. Here's the state:
include:
- ...
0
votes
1
answer
42
views
Salt External Pillar Issues
I am trying to configure an external pillar in github, but no matter what I cannot get the minions to successfully read top.sls. Below is my ext_pillar and pillar_roots config:
pillar_roots:
base:
...
1
vote
1
answer
45
views
Salt state to enable re-run systemd service
I am trying to craft a salt state file to simply ensure-enabled and re-run my one-shot service. I thought it would be nice to re-run if any of the dependent files changed, but honestly this is simple ...
2
votes
0
answers
39
views
Saltstack pillars are empty when I execute pillar.items?
I am trying to initialise pillars in my salt states but when I refresh the pillars and try to look at the data using pillar.item or pillar.ls , I am not able to see it.
My Folder structure at /srv/...
0
votes
1
answer
28
views
Saltstack use environment variables in an external external pillar
I have a salt external pillar that is designed to connect to a remote resource and fetch secrets then inject them into my minion's pillar data. To connect to the remote resource I need to pass the ...
1
vote
2
answers
89
views
set sallt-stack custom grains using salt modules within python
I want to assign one custom grain ("__hW_raid_active") to store information if hardware (1)-or software RAID (0) is used on a minion and set it accordingly. Minions with software RAID have ...
0
votes
0
answers
33
views
Saltstack Config job returns "The minion has not yet returned"
I am new to saltstack and I am trying to run a job using the SaltStack Config.
I have a master and minion(Windows machine).
the init.sls file is the following:
{% set machineName = salt['pillar.get']('...
0
votes
1
answer
61
views
In salt states, we use "grains.host" to get the host details. How do we get the AWS EC2 availability zone name using salt grains?
In salt states, we use "grains.host" to get the host details. How do we get the AWS EC2 availability zone name using salt grains?
To get the hostname I give the below:
{%- if 'aws-dev-01' in ...
0
votes
2
answers
54
views
Error passing a pillar variable with special characters to Salt's cmd.script
I'm doing some automation with Salt using cmd.script with Powershell as the shell. While passing arguments to the state module, I get the error " Cannot process argument transformation on ...
0
votes
0
answers
28
views
Salt schedule not executing function
I have the scheduler enabled on my salt master. I have a job that is configured to execute a runner function on a list of machines every month, like this example:
schedule:
updater:
args:
- ...
2
votes
0
answers
151
views
How to upgrade salt-minion service on Windows Servers from Salt-master without getting an error
So I've a single master which have around 300+ minions connected to it. With the latest upgrade 3004.1; I want to upgrade all of them. They are a mixture of Linux and Windows servers.
I'm able to ...
1
vote
1
answer
91
views
How to configure LXD container devices using saltstack "lxd_container.present" function?
I have the following working Salt state file which: 1) downloads an image 2) creates a container from that image and 3) adds a nic afterwards.
These states work using the following setup:
salt-ssh: ...
0
votes
1
answer
119
views
SaltStack - mine.get is able to grab mine_function data from master, but not in .sls or jinja variable
I hope you can help me with a rather frustrating issue I have been having. I have been trying to remove static config from some config files and move this to Pillar/Mine data using Salt-Stack.
...
0
votes
2
answers
106
views
The 'salt==3000.3' distribution was not found and is required by the application
I have upgraded my salt-master and now it doesn't start with following error :
avril 02 18:28:05 aksalt salt-master[1881]: Traceback (most recent call last):
avril 02 18:28:05 aksalt salt-master[1881]:...
0
votes
0
answers
34
views
How to exclude one object/option while processing a state file on multiple objects
I'm downloading certain microservices in a folder at D:\SaltDownload. I'm storing all of these files on my minions and the contents of the folder would look like this:
serviceA.zip
serviceB.zip
...
0
votes
1
answer
35
views
How to set Recovery options in Windows services using SaltStack
I'm creating a custom Windows Service and deploying it on my salt-minions using Salt master.
The code for it is as follows:
create_service_{{servicename}}:
module.run:
- name: service.create
...
2
votes
2
answers
92
views
How to execute multiple scripts with Salt cmd.script?
I'm trying to apply salt state that consist of multiple scripts. But some reason only script4 is running.
Here's my state file.
#!jinja|yaml|gpg
Distro_Specific_Scripts:
cmd.script:
- name: Run ...
0
votes
1
answer
78
views
Salt State minion id variable
I have a state where at the end I make an API call. I need to use the minion id as a parameter in that call but I'm not sure how to get it. Is there a default variable to use so I can include the id ...
0
votes
1
answer
113
views
How do I get the IP Address of Unauthenticated Minions?
I'm trying to find out if SaltStack supports retrieving the IP addresses of Minions that are not yet authenticated (ie salt-key -L returns minion ID under Unaccepted Keys). I've looked at the ...
0
votes
1
answer
56
views
How to get X-Auth-Token generate by saltstack's login module to work on multiple Master of Masters
I have multiple master of masters and I would like to access all of them through token which salt module generates using below command
curl -sSk http://localhost:8000/login \
-H 'Accept: application/x-...
0
votes
0
answers
21
views
How to pass custom token to multiple Salt MOM?
I am trying to implement custom authentication with uses my org's Oauth and gets a token which I would like to pass to my Salt Master of Master. I would want that token to be available in my custom ...
0
votes
1
answer
87
views
Change user password command not working for salt stack
sudo salt 'vultr.guest' shadow.set_password user '$6$SALTsalt$3ILXYcVfBr/SosT4SMXKrqtgfR6BYm2XgTLQ/Xy95gpNYT7MOEToBUWw1gtV15U2IVFngh0DtUSsgR6Khlldm1'
When running this command to change the user ...
0
votes
1
answer
150
views
SaltStack state issue with file salt.states.file.copy
I am trying to merge a folder with files in source location to a folder with files in destination location
and instead of just copying files / overwriting, salt just wipes out the destination
file....
1
vote
1
answer
78
views
For loop only takes last element in list?
Currently, I'm trying to disable and mask several network related system services using SaltStack under Ubuntu 20.04. Now, things got a bit confusing here. In the end, I need to disable several ...
1
vote
1
answer
160
views
Include multiple salt states in specific order
I want to compose multiple existing salt states into a new one, where they need to be executed in a specific order.
The SaltStack documentation explains that salt states can be included.
As I ...
0
votes
1
answer
69
views
How to refer slot in Saltstack state?
I'm able to use Saltstack Slot to set a value directly. What I need is to use the value inline.
My goal is to use reg.present to set a key for a particular user, like:
HKU\Student\Software\Microsoft\...
1
vote
1
answer
84
views
Why there is no entry in HKU for user created by Salt
I have a user created by Salt user.present state. Details returned by user.info:
----------
account_disabled:
False
account_locked:
False
active:
True
comment:
description:
...
1
vote
1
answer
112
views
Saltstack user.present does not set uid while creating the user
My goal is to have a user with a given uid. I try to have a simple user created with the very basic state:
Add Student:
user.present:
- name: Student
- uid: 333123123123
- ...
1
vote
1
answer
57
views
How to install m2crypto for Salt on Windows?
I compiled the newest m2crypto for some x509 action, got a M2Crypto-0.38.0-cp37-cp37m-win_amd64.whl out of it and installed this via pip.
Now I have a lot of files under C:\salt\bin\Lib\site-packages\...
1
vote
2
answers
62
views
How to watch a file in a state but do not throw an error if file does not exists?
I've got a state which creates a file:
/my/file/path:
file.managed:
- source: salt://salt/file/path
And I've got a service which I want to reload once this file will be created/modified
my-...
0
votes
1
answer
193
views
Saltstack load all files in pillars dir
I am having one large .yml config file, which gets loaded in pillar .sls file and later used in states. To refactor that config file and make it a bit readable, I would like to split it into multiple ...
1
vote
1
answer
155
views
Custom Saltstack Python module function accesible in pillar sls file
I am having some data loaded inside of my pillar file configuration.sls which is using Jinja templating. I would like to do some additional processing on part of that data (dictionary structure) ...
0
votes
0
answers
257
views
JMESPath Find keys whose value is an array containing a specific element (matched by regex)
I have this JSON data structure tst.json:
{
"lo": [
"127.0.0.1",
"::1"
],
"eno1": [
"11.13.91.201",
"2001:...
0
votes
1
answer
21
views
How can I delete a droplet provisioned by salt-stack
I have a training environment that I use salt-stack to deploy lab machines. Is there a way to destroy using a salt command or will I have to use the do api cli for that?
I deployed using the salt-...
0
votes
1
answer
54
views
How to store a particular node from an output of a state.sls file in a variable for SaltStack
I'm working on a project where I need to check the status of a service, let's call it RunningService on multiple(more than 500 machines) Windows servers. We are using Saltstack extensively for our ...
0
votes
1
answer
250
views
Using Saltstack cmd.script with args to Insert Jinja Variable
I am running a powershell script to obtain a particular user's credentials, and then use those credentials in a salt state. This works fine when the username is hardcoded directly in the powershell ...
0
votes
1
answer
49
views
Does Salt provide a mechanism for retrieving data as the master and providing that data to minions?
The problem / use case:
In order for Salt to apply the correct states to minions, Salt needs to be aware of the role a given minion is intended to fill.
We define this through tags on Azure VMs and ...
0
votes
1
answer
22
views
Salt ochestrator delay
I'm running a state file and an orchestrator inside a reactor, I'd like to know if it's possible to delay the orchestrator to make sure it runs after the first state file has finished?
0
votes
1
answer
89
views
Is it possible to use Salt http.query with ssl client verification?
Is it possible to use Salt http.query with ssl client verification?
There are ca_bundle and cert options for salt.utils.http.query command but there is not any key options for private key.
Thank you.
0
votes
1
answer
113
views
Salt reactor runs twice
I'm using a reactor that's triggered whenever a minion is restarted. The reactor then completes 2 steps:
run an orchestrator that executes a runner
enforce minion configuration (checks if minion ...
0
votes
1
answer
55
views
Need help fixing salt stack code to copy file from s3 bucket
I wrote this code to pull file from S3 bucket, change the file permission and execute the code. However, it's not working for me.
download_file_from_s3:
file.managed:
- name: /opt/...