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
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)
serial = Time.new.to_i
resolver = Resolver.new

View File

@ -43,7 +43,7 @@ module Lxc
end
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)
end

View File

@ -31,7 +31,7 @@ module Lxc
end
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)
end
end

View File

@ -21,7 +21,7 @@ def main
end
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_name = registry.data["zone"]["domain"] || "lxc"
zone_template.write(root_path.join("zones", "#{zone_name}.zone"), data: registry.data, zone: zone)