I have a file listing 1 or more server's hostnames hostname_list
that I generate using grep
and awk
. Now I need to execute salt
commands against the hostnames. I am trying, as a test, to run test.ping
to ping each server in the list.
I have tried doing it as a for loop but I can't get it to work.
I've tried numerous variations of:
for i in hostname_list
do
salt $i test.ping
done
hostname_list
the name of a text file containing the names? Or a command that generates such a text file to standard output? Or something else? – Gilles 'SO- stop being evil' Aug 03 '20 at 17:50