Commit 3cb1a197 by Karsa Zoltán István

update default network config and set mac addr tolower

parent a2f4cde8
...@@ -104,12 +104,11 @@ chpasswd: ...@@ -104,12 +104,11 @@ chpasswd:
""".strip() """.strip()
CI_NETWORK_CONFIG_DEF = """ CI_NETWORK_CONFIG_DEF = """
network: version: 2
version: 2 ethernets:
ethernets:
ens3: ens3:
match: match:
macaddress: {{ net.mac }} macaddress: '{{ net.mac }}'
addresses: addresses:
- {{ net.ipv4 }}/{{ net.mask4 }} - {{ net.ipv4 }}/{{ net.mask4 }}
gateway4: {{ net.gateway4 }} gateway4: {{ net.gateway4 }}
...@@ -319,13 +318,13 @@ class NetTemplate: ...@@ -319,13 +318,13 @@ class NetTemplate:
self.name = str(net.vlan.name) self.name = str(net.vlan.name)
self.gateway4 = str(net.vlan.network4).split("/")[0] self.gateway4 = str(net.vlan.network4).split("/")[0]
self.mask4 = str(net.vlan.network4).split("/")[1] self.mask4 = str(net.vlan.network4).split("/")[1]
self.mac = str(net.host.mac) self.mac = str(net.host.mac).lower()
def __init__(self, instance): def __init__(self, instance):
self.vlans = list(NetTemplate.Host(net) for net in instance.interface_set.all() if net.host) self.vlans = list(NetTemplate.Host(net) for net in instance.interface_set.all() if net.host)
self.ipv4 = str(instance.ipv4) self.ipv4 = str(instance.ipv4)
self.ipv6 = str(instance.ipv6) self.ipv6 = str(instance.ipv6)
self.mac = str(instance.mac) self.mac = str(instance.mac).lower()
if instance.primary_host: if instance.primary_host:
addr = str(instance.primary_host.vlan.network4).split("/") addr = str(instance.primary_host.vlan.network4).split("/")
self.gateway4 = addr[0] self.gateway4 = addr[0]
......
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 sign in to comment