community.network.ce_static_route – Manages static route configuration on HUAWEI CloudEngine switches.¶
Note
This plugin is part of the community.network collection (version 1.3.2).
To install it use: ansible-galaxy collection install community.network
.
To use it in a playbook, specify: community.network.ce_static_route
.
Parameters¶
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
vars:
cli:
host: "{{ inventory_hostname }}"
port: "{{ ansible_ssh_port }}"
username: "{{ username }}"
password: "{{ password }}"
transport: cli
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
provider: "{{ cli }}"
- 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
provider: "{{ cli }}"
- 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
provider: "{{ cli }}"
- 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
provider: "{{ cli }}"
- 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
provider: "{{ cli }}"
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Yang yang (@QijunPan)