ansible.builtin.nxos_ping (v2.8.11) — module

Tests reachability using ping from Nexus switch.

| "added in version" 2.1 of ansible.builtin"

Authors: Jason Edelman (@jedelman8), Gabriele Gerbino (@GGabriele)

preview | supported by network

Install Ansible via pip

Install with pip install ansible==2.8.11

Description

Tests reachability using ping from switch to a remote destination.

For a general purpose network module, see the M(net_ping) module.

For Windows targets, use the M(win_ping) module instead.

For targets running Python, use the M(ping) module instead.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 8.8.8.8 using mgmt vrf
  nxos_ping:
    dest: 8.8.8.8
    vrf: management
    host: 68.170.147.165
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to a few different public IPs using mgmt vrf
  nxos_ping:
    dest: nxos_ping
    vrf: management
    host: 68.170.147.165
  with_items:
    - 8.8.8.8
    - 4.4.4.4
    - 198.6.1.4

Inputs

    
vrf:
    description:
    - Outgoing VRF.

dest:
    description:
    - IP address or hostname (resolvable by switch) of remote node.
    required: true

count:
    default: 5
    description:
    - Number of packets to send.

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Determines if the expected result is success or fail.

source:
    description:
    - Source IP Address or hostname (resolvable by switch)

Outputs

commands:
  description: Show the command sent
  returned: always
  sample:
  - ping 8.8.8.8 count 2 vrf management
  type: list
packet_loss:
  description: Percentage of packets lost
  returned: always
  sample: 0.00%
  type: str
packets_rx:
  description: Packets successfully received
  returned: always
  sample: 2
  type: int
packets_tx:
  description: Packets successfully transmitted
  returned: always
  sample: 2
  type: int
rtt:
  description: Show RTT stats
  returned: always
  sample:
    avg: 6.264
    max: 6.564
    min: 5.978
  type: dict