dataset/seed/host-systemd-machined/templates/network-script

18 lines
514 B
Bash

#!/bin/bash
set -e
{% set name = rougail_variable|normalize_family %}
{% set container = machined['machine_' + name] %}
{% set zones = container['zones_' + name] %}
{% if zones| length > 1 %}
{% for zone in zones %}
{% set idx = loop.index - 1 %}
{% if idx %}
{% set intname = "vc-" + idx|string + rougail_variable %}
echo "configuration de {{ intname }}"
/usr/sbin/ip link set dev {{ intname[:15] }} master {{ zone }}
/usr/sbin/ip link set dev {{ intname[:15] }} up
{% endif %}
{% endfor %}
{% endif %}
exit 0