Andreas Vöst
2 years
Moritz Kraus
2 years
Florian Heinle
2 years
Florian Heinle
3 years
Andreas Vöst
4 years

Bolt: Run commands from a file

Posted . Visible to the public.

There's a simple way in bolt to run commands from a file Show archive.org snapshot without caring about BASH escaping:

# /home/user/foo.sh
echo "$(hostname -f): $(uptime)"
echo "${USER}"
echo "${SERVERLIST}" | bolt command run @foo.sh --run-as root --targets -

Use script run Show archive.org snapshot to run a ruby script:

#!/usr/bin/env ruby
# /home/user/bar.rb

puts 'Hello, world!'
echo "${SERVERLIST}" | bolt script run ./bar.rb  --targets -
Andreas Vöst
Last edit
Deleted user #4941
License
Source code in this card is licensed under the MIT License.