Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing rules improvement #536

Open
Isuaven opened this issue Oct 31, 2022 · 6 comments
Open

Routing rules improvement #536

Isuaven opened this issue Oct 31, 2022 · 6 comments
Labels
doc affects documentation

Comments

@Isuaven
Copy link

Isuaven commented Oct 31, 2022

Please add some features:

  • Add installing NetworkManager-config-routing-rules package when NM selected as network_provider. As I googled this package is mandatory for routing-rules support in NM
  • Add support to create routing tables in in /etc/iproute2/rt_tables or /etc/iproute2/rt_tables.d/*.conf if they does not exist
  • Add support for network_provider initscripts
@thom311
Copy link
Contributor

thom311 commented Oct 31, 2022

Add installing NetworkManager-config-routing-rules package when NM selected as network_provider.

The package is renamed to NetworkManager-dispatcher-routing-rules.

As I googled this package is mandatory for routing-rules support in NM

this is not correct (at least not for a very long time)...

well, it depend on how you define "routing-rules support". NM won't use ifcfg rules files. If you want to use those and want NetworkManager to manage the ifcfg file, then you could use the dispatcher script. But that seems not a great solution. Either use network-scripts if you want to use network-scripts (and their rule files), or use NetworkManager's way to configure routing rules.

Add support to create routing tables in in /etc/iproute2/rt_tables or /etc/iproute2/rt_tables.d/*.conf if they does not exist

With what content exactly? NetworkManager itself does not honor those files. In NetworkManager API, tables are only numbers. This role supports readingthose files. They need to be generated by the user first (e.g. by an accompanying part of the playbook).

Add support for network_provider initscripts

Makes sense.

@Isuaven
Copy link
Author

Isuaven commented Nov 3, 2022

well, it depend on how you define "routing-rules support".
They need to be generated by the user first (e.g. by an accompanying part of the playbook).

I want only use yours module as complex solution for confuguring all host network properties witch resolve all dependencies that needs for correct work. If you think thats all right it current implementation its ok, you have more much knowledge in network settings than me, I can be wrong

Makes sense.

Will wait for it

@tyll
Copy link
Member

tyll commented Feb 10, 2023

Thank you for taking the time to report this.

Please add some features:

  • Add support to create routing tables in in /etc/iproute2/rt_tables or /etc/iproute2/rt_tables.d/*.conf if they does not exist

What is your use case, what would you like to achieve? Since the format is pretty simple, the ansible.builtin.lineinfile module seems to be sufficient to handle this. It seems an example for this would be an great addition here .

  • Add support for network_provider initscripts

The initscripts support is in bugfix mode. What is your use case for these instead of using NM?

@tyll tyll added the doc affects documentation label Feb 10, 2023
@Isuaven
Copy link
Author

Isuaven commented Mar 3, 2023

What is your use case, what would you like to achieve? Since the format is pretty simple, the ansible.builtin.lineinfile module seems to be sufficient to handle this. It seems an example for this would be an great addition here .

Im very new in Ansible and my example maybe not correct but Im using this code before yours Role. You can rework it:

- name: Create routing tables
  lineinfile:
    path: /etc/iproute2/rt_tables
    regexp: '^{{ item.table_id }}\s'
    line: "{{ item['table_id'] }}\t{{ item['name'] }}"
  with_items: "{{ routing_tables }}" 
  become: yes

With definition values in host/group vars as

routing_tables:
  - name: "mytable1"
    table_id: 100
  - name: "mytable2"
    table_id: 101

The initscripts support is in bugfix mode. What is your use case for these instead of using NM?

To use in systems where NM is disabled with some architector's reasons

@alessard-trackforce
Copy link

I just spent about 4 hours troubleshooting this same issue myself, and it appears I'm having the exact same issue. Is there anything that I could provide to help with the bug using route tables on initscripts mode?

@alessard-trackforce
Copy link

Or maybe we could at least state clearly in the README that route tables are not supported for initscripts mode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc affects documentation
Projects
None yet
Development

No branches or pull requests

4 participants