From 1025171ce94f51999f23b9b78f63dd429506906b Mon Sep 17 00:00:00 2001 From: Pavel Basov Date: Tue, 16 Dec 2025 16:50:42 +0100 Subject: [PATCH] Cleanup libvirt templates for netris switches --- .../templates/switch-vm.xml.j2 | 77 ------------------- 1 file changed, 77 deletions(-) delete mode 100644 ansible/netris-switches/templates/switch-vm.xml.j2 diff --git a/ansible/netris-switches/templates/switch-vm.xml.j2 b/ansible/netris-switches/templates/switch-vm.xml.j2 deleted file mode 100644 index d4c7b4a..0000000 --- a/ansible/netris-switches/templates/switch-vm.xml.j2 +++ /dev/null @@ -1,77 +0,0 @@ -{# Build list of links for this switch #} -{% set switch_links = [] %} -{% set link_idx = namespace(value=0) %} -{% for link in topology.links %} -{% if link.local == vm_name %} -{% set _ = switch_links.append({'port': link.local_port, 'remote': link.remote, 'remote_port': link.remote_port, 'udp_local': udp_base_port + (link_idx.value * 2), 'udp_remote': udp_base_port + (link_idx.value * 2) + 1}) %} -{% endif %} -{% if link.remote == vm_name %} -{% set _ = switch_links.append({'port': link.remote_port, 'remote': link.local, 'remote_port': link.local_port, 'udp_local': udp_base_port + (link_idx.value * 2) + 1, 'udp_remote': udp_base_port + (link_idx.value * 2)}) %} -{% endif %} -{% set link_idx.value = link_idx.value + 1 %} -{% endfor %} -{# Add server links #} -{% set server_link_start = topology.links | length %} -{% for server in servers | default([]) %} -{% if server.connected_to == vm_name %} -{% set _ = switch_links.append({'port': server.switch_port, 'remote': server.name, 'remote_port': 'eth1', 'udp_local': udp_base_port + ((server_link_start + loop.index0) * 2), 'udp_remote': udp_base_port + ((server_link_start + loop.index0) * 2) + 1}) %} -{% endif %} -{% endfor %} - - {{ vm_name }} - {{ switch_memory_mb }} - {{ switch_vcpus }} - - hvm - - - - - - - - - - - - - destroy - restart - destroy - - /usr/bin/qemu-system-x86_64 - - - - - - - - - - - - - - - - - - - - - - - - - -{% for link in switch_links %} - - - - - - -{% endfor %} - -