|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
require "erb"
|
|
|
|
|
require "netaddr"
|
|
|
|
|
require "pathname"
|
|
|
|
|
require "fileutils"
|
|
|
|
|
|
|
|
|
|
module Lxc
|
|
|
|
|
class Container
|
|
|
|
@ -55,6 +56,13 @@ module Lxc
|
|
|
|
|
c["dn42_ipv6"] = NetAddr::CIDR.create(@dn42_ipv6).to_s(Short: true)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
config_dir = File.dirname(config_path)
|
|
|
|
|
local_conf = File.join(config_dir, "local.conf")
|
|
|
|
|
unless File.exists?(local_conf)
|
|
|
|
|
FileUtils.touch(local_conf)
|
|
|
|
|
end
|
|
|
|
|
opts[:local_conf] = local_conf
|
|
|
|
|
|
|
|
|
|
templ = Template.new(CONFIG_ROOT.join("templates", "config.erb"))
|
|
|
|
|
templ.write(config_path, opts)
|
|
|
|
|
end
|
|
|
|
|