Docs: Added routing table example and Fixes #536#849
Open
Ajith177 wants to merge 2 commits intolinux-system-roles:mainfrom
Open
Docs: Added routing table example and Fixes #536#849Ajith177 wants to merge 2 commits intolinux-system-roles:mainfrom
Ajith177 wants to merge 2 commits intolinux-system-roles:mainfrom
Conversation
Reviewer's GuideUpdates documentation to show how to create named routing tables alongside the network role and clarifies that routing rules and named routing tables are unsupported when using the initscripts provider. Flow diagram for defining named routing tables before applying the network roleflowchart TD
A["Start Ansible playbook"] --> B["Task: Ensure custom routing tables are defined"]
B --> C["ansible.builtin.lineinfile updates /etc/iproute2/rt_tables"]
C --> D["Custom table IDs and names exist in rt_tables"]
D --> E["Task: Apply network role with routes using named tables"]
E --> F["Routes reference existing named tables"]
F --> G["End playbook"]
Flow diagram for routing_rule and named table behavior by providerflowchart TD
A["Configure network role with routing_rule and named table in route"] --> B{network_provider}
B -->|"nm (NetworkManager)"| C["NetworkManager applies configuration"]
C --> D["routing_rule entries processed"]
C --> E["Named table references in route honored"]
B -->|"initscripts"| F["initscripts applies base network configuration"]
F --> G["routing_rule entries silently ignored"]
F --> H["Named table references in route silently ignored"]
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The sentence ending with
/etc/iproute2/rt_tables.d/*.conf.The network role does not create...` is missing a space after the period; updating this will avoid a rendering/reading glitch. - You’ve duplicated the
ansible.builtin.lineinfileexample in both therouteandrouting_rulesections; consider extracting this into a single shared note or referencing one section from the other to reduce future drift between the two examples.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The sentence ending with `/etc/iproute2/rt_tables.d/*.conf`.The network role does not create...` is missing a space after the period; updating this will avoid a rendering/reading glitch.
- You’ve duplicated the `ansible.builtin.lineinfile` example in both the `route` and `routing_rule` sections; consider extracting this into a single shared note or referencing one section from the other to reduce future drift between the two examples.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
rajeshrah22
suggested changes
Mar 16, 2026
README.md
Outdated
| ```yaml | ||
| - name: Ensure custom routing tables are defined | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/iproute2/rt_tables |
There was a problem hiding this comment.
I think the recommendation for the user should be to insert the conf file in
/etc/iproute2/rt_tables.d/{{ item.name }}.conf`
README.md
Outdated
| ```yaml | ||
| - name: Ensure custom routing tables are defined | ||
| ansible.builtin.lineinfile: | ||
| path: /etc/iproute2/rt_tables |
There was a problem hiding this comment.
Same here,
/etc/iproute2/rt_tables.d/{{ item.name }}.conf`
Author
There was a problem hiding this comment.
Thanks @rajeshrah22 I have Updated the examples to use -> /etc/iproute2/rt_tables.d/{{ item.name }}.conf` in both sections.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Closes #536
Two documentation improvements to the
routeandrouting_rulesectionsbased on user confusion reported in the issue thread.
Change 1 — Named routing table creation example
The README already mentions that users must ensure named tables are defined
in
/etc/iproute2/rt_tablesor/etc/iproute2/rt_tables.d/*.confbeforeusing them, but gave no guidance on how to do this.
Added an
ansible.builtin.lineinfileexample showing how to create namedrouting table entries alongside the network role — as suggested by @tyll in
the issue thread.
Change 2 — initscripts provider limitation note
Added a note in the
Limitationssection clarifying thatrouting_ruleand named
tablereferences inrouteare not supported when using theinitscriptsprovider.This was explicitly requested by @alessard-trackforce who spent 4 hours
debugging this undocumented behavior.
Testing
Documentation-only change. No code was modified.
Verified the markdown renders correctly locally.
Summary by Sourcery
Clarify routing table usage and provider limitations in the networking role documentation.
Documentation: