add script to update all lxc container

This commit is contained in:
Jörg Thalheim 2015-01-30 13:26:44 +00:00
parent b89cb8bba3
commit 7f654d8997
1 changed files with 21 additions and 0 deletions

hooks/update-lxc-configs Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env ruby
require "pathname"
require_relative "lib/lxc"
LXC_CONTAINER_ROOT ="/data/containers")
registry =
network =["network"] || {}
network.each do |name, container|
next if container["lxc"] == false
container =,
name: name,
ipv4: container["ipv4"],
ipv6: container["ipv6"],
rootfs: LXC_CONTAINER_ROOT.join(name, "rootfs"),
dn42_ipv4: container["dn42_ipv4"],
dn42_ipv6: container["dn42_ipv6"],
group: container["group"],
vars: container["vars"])
container.write_config(LXC_CONTAINER_ROOT.join(name, "config"))