From 4db49de2d9dade1c30865cb50f5e02be983cd5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 11 Aug 2015 21:32:26 +0000 Subject: [PATCH] prepare configuration split --- .gitignore | 1 + container.json => container-eve.json | 0 hooks/build-split-zone | 2 +- hooks/lib/lxc/container.rb | 2 +- hooks/lib/lxc/rdns.rb | 2 +- {templates => hooks/templates}/config.erb | 0 {templates => hooks/templates}/higgsboson.tk.zone.erb | 0 {templates => hooks/templates}/lxc-zone.erb | 0 {templates => hooks/templates}/rdns-zone.erb | 0 hooks/update-zone | 2 +- 10 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 .gitignore rename container.json => container-eve.json (100%) rename {templates => hooks/templates}/config.erb (100%) rename {templates => hooks/templates}/higgsboson.tk.zone.erb (100%) rename {templates => hooks/templates}/lxc-zone.erb (100%) rename {templates => hooks/templates}/rdns-zone.erb (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ac716cc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +container.json diff --git a/container.json b/container-eve.json similarity index 100% rename from container.json rename to container-eve.json diff --git a/hooks/build-split-zone b/hooks/build-split-zone index cc624de..a8a5595 100755 --- a/hooks/build-split-zone +++ b/hooks/build-split-zone @@ -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 diff --git a/hooks/lib/lxc/container.rb b/hooks/lib/lxc/container.rb index 9abe5d6..86fdd7f 100644 --- a/hooks/lib/lxc/container.rb +++ b/hooks/lib/lxc/container.rb @@ -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 diff --git a/hooks/lib/lxc/rdns.rb b/hooks/lib/lxc/rdns.rb index c98b22e..9a8abc2 100644 --- a/hooks/lib/lxc/rdns.rb +++ b/hooks/lib/lxc/rdns.rb @@ -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 diff --git a/templates/config.erb b/hooks/templates/config.erb similarity index 100% rename from templates/config.erb rename to hooks/templates/config.erb diff --git a/templates/higgsboson.tk.zone.erb b/hooks/templates/higgsboson.tk.zone.erb similarity index 100% rename from templates/higgsboson.tk.zone.erb rename to hooks/templates/higgsboson.tk.zone.erb diff --git a/templates/lxc-zone.erb b/hooks/templates/lxc-zone.erb similarity index 100% rename from templates/lxc-zone.erb rename to hooks/templates/lxc-zone.erb diff --git a/templates/rdns-zone.erb b/hooks/templates/rdns-zone.erb similarity index 100% rename from templates/rdns-zone.erb rename to hooks/templates/rdns-zone.erb diff --git a/hooks/update-zone b/hooks/update-zone index 866b7c3..04d33b4 100755 --- a/hooks/update-zone +++ b/hooks/update-zone @@ -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)