2024-04-04 12:41:58 +02:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
|
|
|
Vagrant.configure("2") do |config|
|
|
|
|
config.vm.box_check_update = false
|
|
|
|
|
pbot-vm: massive refactor
* replace heartbeat with health-check
* instead of steady stream of newlines every 5s, now awaits input
and responds with `vmstat` output
* more reliably use host/config/vm-exec.json to get libvirt domain name
for snapshot-revert, server address, serial ports, vagrant setting, etc
* use iptables/nftables to disable networking
* added guest/bin/disable-network-[iptables,nftables]
* added guest/bin/enable-network-[iptables,nftables]
* replace ugly ___OUTPUT___ texts in sh, bash, ksh, zsh languages
* documentation updates and tweaks
2024-04-10 10:21:18 +02:00
|
|
|
config.vm.define PBOTVM_DOMAIN
|
|
|
|
config.vm.hostname = PBOTVM_DOMAIN
|
2024-04-04 12:41:58 +02:00
|
|
|
|
|
|
|
config.vm.provider :libvirt do |libvirt|
|
pbot-vm: massive refactor
* replace heartbeat with health-check
* instead of steady stream of newlines every 5s, now awaits input
and responds with `vmstat` output
* more reliably use host/config/vm-exec.json to get libvirt domain name
for snapshot-revert, server address, serial ports, vagrant setting, etc
* use iptables/nftables to disable networking
* added guest/bin/disable-network-[iptables,nftables]
* added guest/bin/enable-network-[iptables,nftables]
* replace ugly ___OUTPUT___ texts in sh, bash, ksh, zsh languages
* documentation updates and tweaks
2024-04-10 10:21:18 +02:00
|
|
|
libvirt.title = PBOTVM_DOMAIN
|
|
|
|
libvirt.default_prefix = ""
|
2024-04-04 12:41:58 +02:00
|
|
|
libvirt.qemuargs :value => "-chardev"
|
|
|
|
libvirt.qemuargs :value => "socket,id=charserial1,host=127.0.0.1,port=#{PBOTVM_SERIAL},server=on,wait=off"
|
|
|
|
libvirt.qemuargs :value => "-device"
|
|
|
|
libvirt.qemuargs :value => '{"driver":"isa-serial","chardev":"charserial1","id":"serial1","index":2}'
|
|
|
|
libvirt.qemuargs :value => "-chardev"
|
pbot-vm: massive refactor
* replace heartbeat with health-check
* instead of steady stream of newlines every 5s, now awaits input
and responds with `vmstat` output
* more reliably use host/config/vm-exec.json to get libvirt domain name
for snapshot-revert, server address, serial ports, vagrant setting, etc
* use iptables/nftables to disable networking
* added guest/bin/disable-network-[iptables,nftables]
* added guest/bin/enable-network-[iptables,nftables]
* replace ugly ___OUTPUT___ texts in sh, bash, ksh, zsh languages
* documentation updates and tweaks
2024-04-10 10:21:18 +02:00
|
|
|
libvirt.qemuargs :value => "socket,id=charserial2,host=127.0.0.1,port=#{PBOTVM_HEALTH},server=on,wait=off"
|
2024-04-04 12:41:58 +02:00
|
|
|
libvirt.qemuargs :value => "-device"
|
|
|
|
libvirt.qemuargs :value => '{"driver":"isa-serial","chardev":"charserial2","id":"serial2","index":3}'
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
|
|
|
|
|
|
|
config.vm.synced_folder "../../guest", "/home/vagrant/guest", type: "rsync",
|
|
|
|
rsync__auto: false
|
|
|
|
|
|
|
|
config.vm.provision "shell", inline: "useradd -m vm -s /bin/bash"
|
|
|
|
|
|
|
|
config.vm.provision "shell", inline: "/home/vagrant/guest/bin/setup-guest"
|
|
|
|
|
|
|
|
config.vm.post_up_message = "To start the PBot-VM Guest Server, run `vagrant ssh` to log into the pbot-vagrant-vm and then run `sudo guest-server`."
|
|
|
|
end
|