-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Policy-based routing for NetworkManager
Adding the option to send rules as a dictionary, we seem to need the table_id when using nmconnections. As a dict, it's atleast feasible to try looking up an id from a name in the templates. We're not attempting to find the table name from a string in this iteration. So if using nmconnections the table name needs to be swapped for id. It looks like the older network-scripts rules on EL-systems start priority at 32765 and decrement as more are added, so we're mimicking that behavior. It is also possible to override with a priority added to the dict rule. Also making old rule_RedHat.j2 template compatible with dicts. Basing this on previous templates and documentation [1] [1] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/configuring-policy-based-routing-to-define-alternative-routes_configuring-and-managing-networking
- Loading branch information
Showing
6 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
# {{ ansible_managed }} | ||
|
||
{% for rule in item.rules %} | ||
{% if rule is mapping %} | ||
{% if rule.to is defined %} | ||
to {{ rule.to }} table {{ rule.table }} | ||
{% endif %} | ||
{% if rule.from is defined %} | ||
from {{ rule.from }} table {{ rule.table }} | ||
{% endif %} | ||
{% else %} | ||
{{ rule }} | ||
{% endif %} | ||
{% endfor %} |