Commit eda679b0 authored by John Hackett's avatar John Hackett

Loading network units for systemd before container start

parent e063e898
......@@ -52,23 +52,24 @@ resource "lxd_container" "opennebula" {
profiles = ["${lxd_profile.opennebula.name}"]
file {
source = "networking/lo.interface"
target_file = "/etc/network/interfaces.d/lo"
create_directories = "true"
source = "networking/50-bridge.network"
target_file = "/etc/systemd/network/50-bridge.network"
mode = "0444"
}
file {
source = "networking/network_includes.interface"
target_file = "/etc/network/interfaces"
create_directories = "true"
source = "networking/50-bridge.netdev"
target_file = "/etc/systemd/network/50-bridge.netdev"
mode = "0444"
}
file {
source = "networking/bridge_ip46.interface"
target_file = "/etc/network/interfaces.d/bridge_ip46"
create_directories = "true"
source = "networking/55-bridge-main-interface.network"
target_file = "/etc/systemd/network/55-bridge-main-interface.network"
mode = "0444"
}
provisioner "local-exec" {
command = "lxc exec ${lxd_container.opennebula.name} -- systemctl restart networking && lxc exec ${lxd_container.opennebula.name} -- systemctl status networking && lxc exec ${lxd_container.opennebula.name} -- systemctl start avahi-daemon"
}
......@@ -106,14 +107,14 @@ resource "lxd_network" "opennebula" {
name = "opennebula"
# config {
# ipv4.address = "none"
# ipv6.address = "none"
# }
config {
ipv4.address = "none"
ipv6.address = "none"
}
config {
ipv4.address = "10.0.25.1/24"
ipv4.nat = "true"
ipv6.address = "2001:8b0:baa7:e6b9:4424:8f87:eac4:1000/64"
}
# config {
# ipv4.address = "10.0.25.1/24"
# ipv4.nat = "true"
# ipv6.address = "2001:8b0:baa7:e6b9:4424:8f87:eac4:1000/64"
# }
}
[NetDev]
Name=onebr0
Kind=bridge
\ No newline at end of file
[Match]
Name=onebr0
[Network]
DHCP=yes
DNS=192.168.0.1
\ No newline at end of file
[Match]
Name=eth*
[Network]
Bridge=onebr0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment