Add void linux host support
This commit is contained in:
parent
1f99da7a11
commit
98f70d4d7a
|
@ -0,0 +1,19 @@
|
||||||
|
module VagrantPlugins
|
||||||
|
module HostVoid
|
||||||
|
module Cap
|
||||||
|
class NFS
|
||||||
|
def self.nfs_check_command(env)
|
||||||
|
"/usr/bin/sv status nfs-server"
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.nfs_start_command(env)
|
||||||
|
"/usr/bin/sv up nfs-server "
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.nfs_installed(env)
|
||||||
|
Kernel.system("/usr/bin/xbps-query nfs-utils", [:out, :err] => "/dev/null")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,22 @@
|
||||||
|
require 'pathname'
|
||||||
|
|
||||||
|
require 'vagrant'
|
||||||
|
|
||||||
|
module VagrantPlugins
|
||||||
|
module HostVoid
|
||||||
|
class Host < Vagrant.plugin("2", :host)
|
||||||
|
def detect?(env)
|
||||||
|
os_file = Pathname.new("/etc/os-release")
|
||||||
|
|
||||||
|
if os_file.exist?
|
||||||
|
file = os_file.open
|
||||||
|
while (line = file.gets) do
|
||||||
|
return true if line =~ /^ID="void"/
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,30 @@
|
||||||
|
require "vagrant"
|
||||||
|
|
||||||
|
module VagrantPlugins
|
||||||
|
module HostVoid
|
||||||
|
class Plugin < Vagrant.plugin("2")
|
||||||
|
name "Void host"
|
||||||
|
description "Void linux host support."
|
||||||
|
|
||||||
|
host("void", "linux") do
|
||||||
|
require_relative "host"
|
||||||
|
Host
|
||||||
|
end
|
||||||
|
|
||||||
|
host_capability("void", "nfs_installed") do
|
||||||
|
require_relative "cap/nfs"
|
||||||
|
Cap::NFS
|
||||||
|
end
|
||||||
|
|
||||||
|
host_capability("void", "nfs_check_command") do
|
||||||
|
require_relative "cap/nfs"
|
||||||
|
Cap::NFS
|
||||||
|
end
|
||||||
|
|
||||||
|
host_capability("void", "nfs_start_command") do
|
||||||
|
require_relative "cap/nfs"
|
||||||
|
Cap::NFS
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue