Puppet Bolt ist ein quelloffenes, agentenloses Orchestrierungswerkzeug zur Automatisierung von Ad-hoc-Aufgaben, Skripten und Multi-Node-Workflows über Standard-SSH oder WinRM.
Installation
# macOS (Homebrew)
brew install puppetlabs/puppet/puppet-bolt
# Windows (Chocolatey)
choco install puppet-bolt
# Linux (Debian / Ubuntu)
wget https://apt.puppet.com/puppet-tools-release-$(lsb_release -cs).deb
sudo dpkg -i puppet-tools-release-*.deb
sudo apt-get update && sudo apt-get install puppet-bolt
Task-Modul erstellen
Tasks lassen sich in jeder auf den Zielhosts unterstützten Sprache verfassen (Bash, Python, PowerShell, Ruby):
# Tasks-Verzeichnis im Modul anlegen
mkdir -p ~/.puppetlabs/bolt/modules/mymodule/tasks
# Skript im Task-Ordner ablegen und ausführbar machen
cp myscript.sh ~/.puppetlabs/bolt/modules/mymodule/tasks/
chmod +x ~/.puppetlabs/bolt/modules/mymodule/tasks/myscript.sh
Tasks ausführen
Führen Sie Tasks per SSH-Private-Key-Authentifizierung auf mehreren Remote-Nodes gleichzeitig aus:
bolt task run mymodule::myscript \
--targets node1.example.com,node2.example.com \
--user root \
--private-key ~/.ssh/id_rsa
Ad-hoc-Befehle & Skripte ausführen
# Einzeiligen Befehl auf allen Inventory-Zielen ausführen
bolt command run 'uptime' --targets all
# Lokales Skript entfernt ausführen
bolt script run ./deploy.sh --targets webservers