Skip to content

Commit

Permalink
Add custom routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Dehmel authored and Normo committed Oct 10, 2024
1 parent 405966f commit 147bf53
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions roles/netplan/templates/config.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ network:
routes:
- to: "default"
via: "{{ ethernet['gateway4'] }}"
{% if ethernet['routes'] is defined %}
{% for route in ethernet['routes']%}
- to: "{{ route.to }}"
via: "{{ route.via }}"
{% endfor %}
{% endif %}
{% endif %}
{% if ethernet['gateway4'] is not defined %}
{% if ethernet['routes'] is defined %}
routes:
{% for route in ethernet['routes']%}
- to: "{{ route.to }}"
via: "{{ route.via }}"
{% endfor %}
{% endif %}
{% endif %}
{% if ethernet['addresses'] is defined %}
addresses:
Expand Down

0 comments on commit 147bf53

Please sign in to comment.