Add Atomic guest support
This commit is contained in:
parent
261ef836e0
commit
bd2f2fc3a0
|
@ -0,0 +1,11 @@
|
|||
module VagrantPlugins
|
||||
module GuestAtomic
|
||||
module Cap
|
||||
class ChangeHostName
|
||||
def self.change_host_name(machine, name)
|
||||
machine.communicate.sudo("hostnamectl set-hostname #{name}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
module VagrantPlugins
|
||||
module GuestAtomic
|
||||
module Cap
|
||||
module Docker
|
||||
def self.docker_daemon_running(machine)
|
||||
machine.communicate.test("test -S /run/docker.sock")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,11 @@
|
|||
require "vagrant"
|
||||
|
||||
module VagrantPlugins
|
||||
module GuestAtomic
|
||||
class Guest < Vagrant.plugin("2", :guest)
|
||||
def detect?(machine)
|
||||
machine.communicate.test("grep 'ostree=' /proc/cmdline")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,25 @@
|
|||
require 'vagrant'
|
||||
|
||||
module VagrantPlugins
|
||||
module GuestAtomic
|
||||
class Plugin < Vagrant.plugin("2")
|
||||
name "Atomic Host guest"
|
||||
description "Atomic Host guest support."
|
||||
|
||||
guest("atomic", "fedora") do
|
||||
require File.expand_path("../guest", __FILE__)
|
||||
Guest
|
||||
end
|
||||
|
||||
guest_capability("atomic", "change_host_name") do
|
||||
require_relative "cap/change_host_name"
|
||||
Cap::ChangeHostName
|
||||
end
|
||||
|
||||
guest_capability("atomic", "docker_daemon_running") do
|
||||
require_relative "cap/docker"
|
||||
Cap::Docker
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue