How to use this box with Vagrant:
Vagrant.configure("2") do |config|
config.vm.box = "ailispaw/rancheros"
config.vm.box_version = "0.6.2"
end
vagrant init ailispaw/rancheros \
--box-version 0.6.2
vagrant up
This version was created about 9 years ago.
Cf.) https://github.com/ailispaw/rancheros-iso-box
Cf.) https://github.com/ailispaw/rancheros-cluster
module VagrantPlugins
module GuestLinux
class Plugin < Vagrant.plugin("2")
guest_capability("linux", "change_host_name") do
Cap::ChangeHostName
end
guest_capability("linux", "configure_networks") do
Cap::ConfigureNetworks
end
end
end
end
Vagrant.configure(2) do |config|
config.vm.define "rancheros"
config.vm.box = "ailispaw/rancheros"
config.vm.hostname = "rancheros"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ["nolock", "vers=3", "udp"]
if Vagrant.has_plugin?("vagrant-triggers") then
config.trigger.after [:up, :resume] do
info "Adjusting datetime after suspend and resume."
run_remote <<-EOT.prepend("\n")
sudo system-docker stop ntp
sudo ntpd -n -q -g -I eth0 > /dev/null
date
sudo system-docker start ntp
EOT
end
end
# Adjusting datetime before provisioning.
config.vm.provision :shell, run: "always" do |sh|
sh.inline = <<-EOT
system-docker stop ntp
ntpd -n -q -g -I eth0 > /dev/null
date
system-docker start ntp
EOT
end
config.vm.provision :docker do |d|
d.pull_images "busybox"
d.run "simple-echo",
image: "busybox",
args: "-p 8080:8080",
cmd: "nc -p 8080 -l -l -e echo hello world!"
end
config.vm.network :forwarded_port, guest: 8080, host: 8080
end