ansible / ansible.builtin / v2.5.6 / module / ce_static_route Manages static route configuration on HUAWEI CloudEngine switches. | "added in version" 2.4 of ansible.builtin" Authors: Yang yang (@CloudEngine-Ansible) preview | supported by communityansible.builtin.ce_static_route (v2.5.6) — module
pip
Install with pip install ansible==2.5.6
Manages the static routes on HUAWEI CloudEngine switches.
- 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 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 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 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 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 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 }}"
tag: default: null description: - Route tag value (numeric). required: false vrf: default: null description: - VPN instance of destination ip address. required: false mask: description: - Destination ip mask of static route. required: true pref: default: null description: - Preference or administrative difference of route (range 1-255). required: false state: choices: - present - absent default: present description: - Specify desired state of the resource. required: false aftype: choices: - v4 - v6 description: - Destination ip address family type of static route. required: true prefix: description: - Destination ip address of static route. required: true destvrf: default: null description: - VPN instance of next hop ip address. required: false next_hop: default: null description: - Next hop address of static route. required: false description: default: null description: - Name of the route. Used with the name parameter on the CLI. required: false nhp_interface: default: null description: - Next hop interface full name of static route. required: false
changed: description: check to see if a change was made on the device returned: always sample: true type: boolean end_state: description: k/v pairs of switchport after module execution returned: always sample: description: testing mask: '24' next_hop: 3.3.3.3 pref: '100' prefix: 192.168.20.0 tag: 'null' type: dict existing: description: k/v pairs of existing switchport returned: always sample: {} type: dict proposed: description: k/v pairs of parameters passed into module returned: always sample: description: testing mask: '24' next_hop: 3.3.3.3 pref: '100' prefix: 192.168.20.642 vrf: _public_ type: dict updates: description: command list sent to the device returned: always sample: - ip route-static 192.168.20.0 255.255.255.0 3.3.3.3 preference 100 description testing type: list