Skip to content

Commit

Permalink
Merge pull request #325 from axldd/add-netplan-routes
Browse files Browse the repository at this point in the history
Add custom routes
  • Loading branch information
Normo authored Oct 10, 2024
2 parents 405966f + 147bf53 commit 2c4c82b
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 2c4c82b

Please sign in to comment.