LXC configuration + useful hooks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
lxc-config/hooks/update-lxc-configs

20 lines
779 B

#!/usr/bin/env ruby
require "pathname"
require_relative "lib/lxc"
registry = Lxc::Registry.new
container_root = Pathname.new(registry.data["zone"]["lxc-root"])
network = registry.data["network"] || {}
network.each do |name, container|
next if container["lxc"] == false
shared_rootfs = registry.data["zone"]["shared_rootfs"]
container = Lxc::Container.new(registry.data,
name: name,
ipv4: container["ipv4"],
ipv6: container["ipv6"],
ula: container["ula"],
group: container["group"],
vars: container["vars"])
container.write_config(container_root.join(name, "config"))
end