community.network.ce_static_route module – Manages static route configuration on HUAWEI CloudEngine switches.
Note
This module is part of the community.network collection (version 5.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.ce_static_route
.
Synopsis
Manages the static routes on HUAWEI CloudEngine switches.
Parameters
Parameter |
Comments |
---|---|
Destination ip address family type of static route. Choices:
|
|
Name of the route. Used with the name parameter on the CLI. |
|
VPN instance of next hop ip address. |
|
Destination ip mask of static route. |
|
Next hop address of static route. |
|
Next hop interface full name of static route. |
|
Preference or administrative difference of route (range 1-255). |
|
Destination ip address of static route. |
|
Specify desired state of the resource. Choices:
|
|
Route tag value (numeric). |
|
VPN instance of destination ip address. |
Notes
Note
If no vrf is supplied, vrf is set to default.
If state=absent, the route will be removed, regardless of the non-required parameters.
This module requires the netconf system service be enabled on the remote device being managed.
Recommended connection is
netconf
.This module also works with
local
connections for legacy playbooks.
Examples
- name: Static route module test
hosts: cloudengine
connection: local
gather_facts: no
tasks:
- name: Config a ipv4 static route, next hop is an address and that it has the proper description
community.network.ce_static_route:
prefix: 2.1.1.2
mask: 24
next_hop: 3.1.1.2
description: 'Configured by Ansible'
aftype: v4
- name: Config a ipv4 static route ,next hop is an interface and that it has the proper description
community.network.ce_static_route:
prefix: 2.1.1.2
mask: 24
next_hop: 10GE1/0/1
description: 'Configured by Ansible'
aftype: v4
- name: Config a ipv6 static route, next hop is an address and that it has the proper description
community.network.ce_static_route:
prefix: fc00:0:0:2001::1
mask: 64
next_hop: fc00:0:0:2004::1
description: 'Configured by Ansible'
aftype: v6
- name: Config a ipv4 static route, next hop is an interface and that it has the proper description
community.network.ce_static_route:
prefix: fc00:0:0:2001::1
mask: 64
next_hop: 10GE1/0/1
description: 'Configured by Ansible'
aftype: v6
- name: Config a VRF and set ipv4 static route, next hop is an address and that it has the proper description
community.network.ce_static_route:
vrf: vpna
prefix: 2.1.1.2
mask: 24
next_hop: 3.1.1.2
description: 'Configured by Ansible'
aftype: v4
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
check to see if a change was made on the device Returned: always Sample: |
|
k/v pairs of switchport after module execution Returned: always Sample: |
|
k/v pairs of existing switchport Returned: always Sample: |
|
k/v pairs of parameters passed into module Returned: always Sample: |
|
command list sent to the device Returned: always Sample: |