prepare configuration split

This commit is contained in:
Jörg Thalheim 2015-08-11 21:32:26 +00:00
parent d5a49ae4ef
commit 4db49de2d9
10 changed files with 5 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
container.json

View File

@ -36,7 +36,7 @@ class Resolver
end end
end end
template_path = Lxc::CONFIG_ROOT.join("templates/higgsboson.tk.zone.erb") template_path = Lxc::CONFIG_ROOT.join("hooks/templates/higgsboson.tk.zone.erb")
template = Lxc::Template.new(template_path) template = Lxc::Template.new(template_path)
serial = Time.new.to_i serial = Time.new.to_i
resolver = Resolver.new resolver = Resolver.new

View File

@ -43,7 +43,7 @@ module Lxc
end end
opts[:local_conf] = local_conf opts[:local_conf] = local_conf
templ = Template.new(CONFIG_ROOT.join("templates", "config.erb")) templ = Template.new(CONFIG_ROOT.join("hooks", "templates", "config.erb"))
templ.write(config_path, opts) templ.write(config_path, opts)
end end

View File

@ -31,7 +31,7 @@ module Lxc
end end
def write_zone_file(path) def write_zone_file(path)
zone_template = Template.new(CONFIG_ROOT.join("templates/rdns-zone.erb")) zone_template = Template.new(CONFIG_ROOT.join("hooks/templates/rdns-zone.erb"))
zone_template.write(path.join("zones", name), zone: self, data: data) zone_template.write(path.join("zones", name), zone: self, data: data)
end end
end end

View File

@ -21,7 +21,7 @@ def main
end end
root_path = Pathname.new(File.expand_path("../..", __FILE__)) root_path = Pathname.new(File.expand_path("../..", __FILE__))
zone_template = Lxc::Template.new(root_path.join("templates/lxc-zone.erb")) zone_template = Lxc::Template.new(root_path.join("hooks/templates/lxc-zone.erb"))
zone = registry.data["zone"] || {} zone = registry.data["zone"] || {}
zone_name = registry.data["zone"]["domain"] || "lxc" zone_name = registry.data["zone"]["domain"] || "lxc"
zone_template.write(root_path.join("zones", "#{zone_name}.zone"), data: registry.data, zone: zone) zone_template.write(root_path.join("zones", "#{zone_name}.zone"), data: registry.data, zone: zone)