W3cubDocs

/Ansible

community.network.ce_netstream_export – Manages netstream export on HUAWEI CloudEngine switches.

Note

This plugin is part of the community.network collection (version 3.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_netstream_export.

Synopsis

  • Configure NetStream flow statistics exporting and versions for exported packets on HUAWEI CloudEngine switches.

Parameters

Parameter Choices/Defaults Comments
as_option
string
    Choices:
  • origin
  • peer
Specifies the AS number recorded in the statistics as the original or the peer AS number.
bgp_nexthop
string
    Choices:
  • enable
  • disable
Configures the statistics to carry BGP next hop information. Currently, only V9 supports the exported packets carrying BGP next hop information.
host_ip
string
Specifies destination address which can be IPv6 or IPv4 of the exported NetStream packet.
host_port
string
Specifies the destination UDP port number of the exported packets. The value is an integer that ranges from 1 to 65535.
host_vpn
string
Specifies the VPN instance of the exported packets carrying flow statistics. Ensure the VPN instance has been created on the device.
source_ip
string
Specifies source address which can be IPv6 or IPv4 of the exported NetStream packet.
state
string
    Choices:
  • present
  • absent
Manage the state of the resource.
type
string / required
    Choices:
  • ip
  • vxlan
Specifies NetStream feature.
version
string
    Choices:
  • 5
  • 9
Sets the version of exported packets.

Notes

Note

  • Recommended connection is network_cli.
  • This module also works with local connections for legacy playbooks.

Examples

- name: Netstream export 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: Configures the source address for the exported packets carrying IPv4 flow statistics.
    community.network.ce_netstream_export:
      type: ip
      source_ip: 192.8.2.2
      provider: "{{ cli }}"

  - name: Configures the source IP address for the exported packets carrying VXLAN flexible flow statistics.
    community.network.ce_netstream_export:
      type: vxlan
      source_ip: 192.8.2.3
      provider: "{{ cli }}"

  - name: Configures the destination IP address and destination UDP port number for the exported packets carrying IPv4 flow statistics.
    community.network.ce_netstream_export:
      type: ip
      host_ip: 192.8.2.4
      host_port: 25
      host_vpn: test
      provider: "{{ cli }}"

  - name: Configures the destination IP address and destination UDP port number for the exported packets carrying VXLAN flexible flow statistics.
    community.network.ce_netstream_export:
      type: vxlan
      host_ip: 192.8.2.5
      host_port: 26
      host_vpn: test
      provider: "{{ cli }}"

  - name: Configures the version number of the exported packets carrying IPv4 flow statistics.
    community.network.ce_netstream_export:
      type: ip
      version: 9
      as_option: origin
      bgp_nexthop: enable
      provider: "{{ cli }}"

  - name: Configures the version for the exported packets carrying VXLAN flexible flow statistics.
    community.network.ce_netstream_export:
      type: vxlan
      version: 9
      provider: "{{ cli }}"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
changed
boolean
always
check to see if a change was made on the device

Sample:
True
end_state
dictionary
always
k/v pairs of end attributes on the device

Sample:
{'as_option': 'origin', 'bgp_nexthop': 'enable', 'host_ip': '192.8.5.6', 'host_port': '26', 'host_vpn': 'test', 'source_ip': '192.8.2.5', 'type': 'ip', 'version': '9'}
existing
dictionary
always
k/v pairs of existing attributes on the device

Sample:
{'as_option': None, 'bgp_nexthop': 'disable', 'host_ip': None, 'host_port': None, 'host_vpn': None, 'source_ip': None, 'type': 'ip', 'version': None}
proposed
dictionary
always
k/v pairs of parameters passed into module

Sample:
{'as_option': 'origin', 'bgp_nexthop': 'enable', 'host_ip': '192.8.5.6', 'host_port': '26', 'host_vpn': 'test', 'source_ip': '192.8.2.5', 'state': 'present', 'type': 'ip', 'version': '9'}
updates
list / elements=string
always
command list sent to the device

Sample:
['netstream export ip source 192.8.2.5', 'netstream export ip host 192.8.5.6 26 vpn-instance test', 'netstream export ip version 9 origin-as bgp-nexthop']


Authors

  • Zhijin Zhou (@QijunPan)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/network/ce_netstream_export_module.html