ansible-role-networking/templates/systemd.netdev.j2

47 lines
1.3 KiB
Plaintext
Raw Normal View History

#jinja2: lstrip_blocks: "True", trim_blocks: "True"
2022-03-18 13:27:26 +00:00
#
# {{ ansible_managed }}
#
{% if item.netdev_options is defined and item.netdev_options | length > 0 %}
[NetDev]
{% for netdev_option in item.netdev_options %}
{{ netdev_option.key }}={{ netdev_option.value }}
{% endfor %}
{% endif %}
{% if item.bond_options is defined and item.bond_options | length > 0 %}
[Bond]
{% for bond_option in item.bond_options %}
{{ bond_option.key }}={{ bond_option.value }}
{% endfor %}
{% endif %}
{% if item.bridge_options is defined and item.bridge_options | length > 0 %}
[Bridge]
{% for bridge_option in item.bridge_options %}
{{ bridge_option.key }}={{ bridge_option.value }}
{% endfor %}
{% endif %}
{% if item.wireguard_options is defined and item.wireguard_options | length > 0 %}
[WireGuard]
{% for wireguard_option in item.wireguard_options %}
{{ wireguard_option.key }}={{ wireguard_option.value }}
{% endfor %}
{% endif %}
{% if item.wireguard_peers is defined %}
{% for wireguard_peer in item.wireguard_peers %}
{% if wireguard_peer.options is defined and wireguard_peer.options | length > 0 %}
{% if wireguard_peer.name is defined and wireguard_peer.name | length > 0 %}
# {{ wireguard_peer.name }}
{% endif %}
2022-03-18 13:27:26 +00:00
[WireGuardPeer]
{% for option in wireguard_peer.options %}
{{ option.key }}={{ option.value }}
2022-03-18 13:27:26 +00:00
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}