2015-01-30 13:26:44 +00:00
|
|
|
#!/usr/bin/env ruby
|
|
|
|
require "pathname"
|
|
|
|
require_relative "lib/lxc"
|
|
|
|
|
|
|
|
LXC_CONTAINER_ROOT = Pathname.new("/data/containers")
|
|
|
|
|
|
|
|
registry = Lxc::Registry.new
|
|
|
|
network = registry.data["network"] || {}
|
|
|
|
network.each do |name, container|
|
|
|
|
next if container["lxc"] == false
|
|
|
|
container = Lxc::Container.new(registry.data,
|
|
|
|
name: name,
|
|
|
|
ipv4: container["ipv4"],
|
|
|
|
ipv6: container["ipv6"],
|
2015-08-05 15:33:37 +00:00
|
|
|
ula: container["ula"],
|
2015-01-30 13:26:44 +00:00
|
|
|
rootfs: LXC_CONTAINER_ROOT.join(name, "rootfs"),
|
|
|
|
group: container["group"],
|
|
|
|
vars: container["vars"])
|
|
|
|
container.write_config(LXC_CONTAINER_ROOT.join(name, "config"))
|
|
|
|
end
|