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

Add parameter to add ipv4 routes to nmcli module #54491

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
2 participants
@netzvieh
Copy link
Contributor

commented Mar 27, 2019

SUMMARY

Adds a new parameter to set ipv4.routes for the ethernet, bond and team
connection types.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

nmcli

ADDITIONAL INFORMATION

nmcli allows for a connection to set other routes, not just the default gateway. This wasn't possible with the nmcli module as there was no parameter for it.

Example:

---
- hosts: localhost
  become: true
  tasks:
    - nmcli:
        type: ethernet
        conn_name: foobar
        ip4: 192.168.25.222/24
        gw4: 192.168.25.1
        route4:
          - '192.168.20.0/24 192.168.25.2'
          - '192.168.21.0/24 192.168.25.3'
        state: present
nmcli c edit foobar

===| nmcli interactive connection editor |===

Editing existing '802-3-ethernet' connection: 'foobar'

Type 'help' or '?' for available commands.
Type 'describe [<setting>.<prop>]' for detailed property description.

You may edit the following settings: connection, 802-3-ethernet (ethernet), 802-1x, dcb, ipv4, ipv6, tc, proxy
nmcli> print ipv4.routes
ipv4.routes: { ip = 192.168.20.0/24, nh = 192.168.25.2 }; { ip = 192.168.21.0/24, nh = 192.168.25.3 }
Add route4 parameter to nmcli module
Adds a new parameter to set ipv4.routes for the ethernet, bond and team
connection types.
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.