Read more

Bolt: Run commands from a file

Andreas Vöst
July 11, 2022Software engineer at makandra GmbH

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 -
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

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 -
Posted by Andreas Vöst to makandra Operations (2022-07-11 13:23)