Questions tagged [variables]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
69 views

How to permanently set vault token and url remote server in macos

On Linux I'm setting vault variables to /etc/environment next: export VAULT_URL='https://some-remote-server.org:8200/' export VAULT_TOKEN='SoMeToKeN' But when I'm typeing this in macos, after $> ...
-1
votes
2answers
57 views

SCP exit 0 when using un-initialized variable and fail to copy

I am trying to test if a file fails to transfer using SCP. I noticed if I use a un-initialized variable, I get exit 0 even though the SCP fails. For example, I have an empty variable called ...
1
vote
2answers
68 views

Bash script - check if a variable is located between 2 others variables?

In a Bash script I want to check if var1 is located between var2 and var3. But I can't find how to do it. Something like this. var1=15 var2=10 var3=20 if [ "$var1" is located beetween "...
0
votes
0answers
15 views

Set PowerShell Azure SQL Connection String Parameter

I have an Azure SQL database in one resource group and a key vault in a separate resource group. Everything is already deployed but I'd like to assign the connection string values of the sql db to a ...
0
votes
1answer
31 views

BASH script variables have no values

I am writing a simple script to clean up log folders. This is the most basic thing I can think of, and yet it does not work because the variables don't seem to be set. Here is the shell script ...
0
votes
0answers
111 views

Saltstack - Jinja variable 'selinux_policy_dir' is undefined. New salt user

I'm a total n00b to writing salt states. The other day I created my first. It's just an automated deployment of a new auditing tool, along with a SELinux policy for it, etc. It seems to work fine. ...
0
votes
1answer
61 views

Variables covered in b' ' in Python 3

I am sure this is a fairly noob question, I have googled, and cannot find a straight answer, but I may be asking the wrong thing... I am trying to make an Out Of Box Configuration script, and all the ...
0
votes
1answer
60 views

ansible: difference between a variable and a fact

While I'm using Ansible for quite some time, I'm not sure I really understand the differences between a variable and a fact. Could someone explain me, possibly with an example where it really make a ...
0
votes
1answer
61 views

Shell script to remove quotes when using SED

I'm trying to change a line of syntax in a config file where the line looks like the following: host="192.0.2.100" I'm writing a script that would require input the user to change the ip ...
1
vote
0answers
22 views

Nagios - Create a Costum Variable

I created a variable in define host {} like this : define host { [...] _type box } I modified in C files to use this variable for a specific reason, but ...
1
vote
2answers
225 views

How costly are nginx variables?

nginx FAQ Is there a proper way to use nginx variables to make sections of the configuration shorter, using them as macros for making parts of configuration work as templates? ) saying (bold is mine): ...
0
votes
1answer
695 views

Get the previous day date as variable in batch file from powershell command output

The scenario is like this. I need a previous day date (i.e. Today -1) as variable in a batch file. But if previous day is Sunday (i.e. script running on Monday) it should return the Saturday's date (i....
1
vote
1answer
279 views

How does systemctl variable escaping work in a shell?

I want do a batch job with systemctl, something like: systemctl status v2ray-haproxy@{1..5} That's fine. But when i change 5 to a variable: n=5;systemctl status v2ray-haproxy@{1..$n} It's not ...
0
votes
2answers
160 views

ssh : user and host / host_ip as variables

I would like to create an array with the variables $user and $host in order to pass them to the ssh command. I have tried: my_array=('something1' 'something2' 'user' 'host_ip') sudo ssh ${my_array[2]...
1
vote
3answers
3k views

Kickstart CentOS 7 with pre-defined static IP and hostname (%pre) and used in KS, possible?

I don't know if this is possible, but going to ask anyways. I am trying to Kickstart newer servers of us with CentOS 7. So far I got most working, however for some reason if I use variables in the %...
2
votes
1answer
960 views

ANSIBLE how to locate dict at host_vars file?

I try to master the work with dictionaries at ansible. When I include dict to playbook as at example all works like charm. But when I try to include vars block to my host_vars/myserv.yml file like ...
0
votes
1answer
1k views

Ansible - manage installed apps and send output via email - variables are filling wrong

so i have this playbook, which checking, if there are installed selected packages. nothing special there. Then i would like to send an output to my email, if everything went right etc. --- - name: ...
0
votes
0answers
410 views

How can I add multiple variables in Ansible PB from another file

I plan to add few hundred of lines in some files using Ansible. My idea is to put all those lines in a file and then use a variable inside the playbook. This is the first part. The second one is ...
3
votes
1answer
11k views

Get PowerShell command output as a variable in bat (cmd) script

I'm trying to get FQDN of a host in some .cmd file. We have disjointed AD domain so "@echo %COMPUTERNAME%.%USERDNSDOMAIN%" does not work. I mean it works, but returns wrong value. The solution I ...