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

55 lines
1.4 KiB
Plaintext
Raw Normal View History

2022-03-18 13:27:26 +00:00
#jinja2: lstrip_blocks: "True", trim_blocks: "True"
#
# {{ ansible_managed }}
#
{% if item.match_options is defined and item.match_options | length > 0 %}
[Match]
{% for match_option in item.match_options %}
{{ match_option.key }}={{ match_option.value }}
{% endfor %}
{% endif %}
{% if item.network_options is defined and item.network_options | length > 0 %}
[Network]
{% for network_option in item.network_options %}
{{ network_option.key }}={{ network_option.value }}
{% endfor %}
{% endif %}
{% if item.dhcp_options is defined and item.dhcp_options | length > 0 %}
[DHCP]
{% for dhcp_option in item.dhcp_options %}
{{ dhcp_option.key }}={{ dhcp_option.value }}
{% endfor %}
{% endif %}
{% if item.addresses is defined %}
2022-03-18 13:27:26 +00:00
{% for address in item.addresses %}
{% if address.options is defined and address.options | length > 0 %}
{% if address.name is defined and address.name | length > 0 %}
# {{ address.name }}
{% endif %}
2022-03-18 13:27:26 +00:00
[Address]
{% for option in address.options %}
{{ option.key }}={{ option.value }}
2022-03-18 13:27:26 +00:00
{% endfor %}
{% endif %}
2022-03-18 13:27:26 +00:00
{% endfor %}
{% endif %}
{% if item.routes is defined %}
{% for route in item.routes %}
{% if route.options is defined and route.options | length > 0 %}
{% if route.name is defined and route.name | length > 0 %}
# {{ route.name }}
{% endif %}
2022-03-18 13:27:26 +00:00
[Route]
{% for option in route.options %}
{{ option.key }}={{ option.value }}
{% endfor %}
{% endif %}
2022-03-18 13:27:26 +00:00
{% endfor %}
{% endif %}