Automatically Provision Vagrant Virtual Machines as Salt Slaves

Create a new, fully configured virtual computer in less than a minute. Keep configuration in version control. Manage trough configuration management system.

This short example only contains Vagrantfile for slave. This configures new vagrant virtual machine as salt slave. You will also need a working salt master to use this.
This short example is not aimed at beginners. Prerequisites: Linux command line, salt configuration management system and vagrant virtualization.


# Vagrantfile
# Copyright 2018 Tero Karvinen
# Based on
$tscript = <<TSCRIPT
touch /tmp/
sudo apt-get update
sudo apt-get -y install salt-minion
echo -e 'master:\nid: tero001'|sudo tee /etc/salt/minion
sudo systemctl restart salt-minion
Vagrant.configure("2") do |config| = "bento/ubuntu-16.04"
 config.vm.provision "shell", inline: $tscript

What Next?

See how my student Jussi Isosomppi used similar configuration to control over two thousand slaves (git repository).

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *