From 985fbb321bb0aec81f87ff77720f9e1cb4e8763f Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 29 Oct 2023 15:29:20 +0100 Subject: [PATCH] [PR #7403/09ae963f backport][stable-7] nmcli: add additional documentation for routing_rules4 option (#7425) nmcli: add additional documentation for routing_rules4 option (#7403) * Add additional documentation for routing_rules4 option. I had some trouble initially getting this to work as I wasn't very clear on what was required to that end I have added an example task and fixed what I suspect is a typo in the description. * Update nmcli.py Remove trailing whitespace. (cherry picked from commit 09ae963f5859b1c4adfb58d269ea132b8ae509ea) Co-authored-by: Alistair MacCallum [Vaarst] <81685753+AlistairMaccallum@users.noreply.github.com> --- plugins/modules/nmcli.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/modules/nmcli.py b/plugins/modules/nmcli.py index 3df3c5d558..3882f85179 100644 --- a/plugins/modules/nmcli.py +++ b/plugins/modules/nmcli.py @@ -169,7 +169,7 @@ options: version_added: 2.0.0 routing_rules4: description: - - Is the same as in an C(ip route add) command, except always requires specifying a priority. + - Is the same as in an C(ip rule add) command, except always requires specifying a priority. type: list elements: str version_added: 3.3.0 @@ -1489,6 +1489,22 @@ EXAMPLES = r''' vlandev: eth0 vlanid: 5 state: present + +## Defining ip rules while setting a static IP +## table 'production' is set with id 200 in this example. +- name: Set Static ips for interface with ip rules and routes + community.general.nmcli: + type: ethernet + conn_name: 'eth0' + ip4: '192.168.1.50' + gw4: '192.168.1.1' + state: present + routes4_extended: + - ip: "0.0.0.0/0" + next_hop: "192.168.1.1" + table: "production" + routing_rules4: + - "priority 0 from 192.168.1.50 table 200" ''' RETURN = r"""#