cisco.nxos.nxos_ping (7.0.0) — module

Tests reachability using ping from Nexus switch.

| "added in version" 1.0.0 of cisco.nxos"

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

Install collection

Install with ansible-galaxy collection install cisco.nxos:==7.0.0


Add to requirements.yml

  collections:
    - name: cisco.nxos
      version: 7.0.0

Description

Tests reachability using ping from switch to a remote destination.

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

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

For targets running Python, use the M(ansible.builtin.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
  cisco.nxos.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
  cisco.nxos.nxos_ping:
    dest: "{{ item }}"
    vrf: management
    host: 68.170.147.165
  with_items:
    - 8.8.8.8
    - 4.4.4.4
    - 198.6.1.4
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 8.8.8.8 using mgmt vrf, size and df-bit
  cisco.nxos.nxos_ping:
    dest: 8.8.8.8
    df_bit: true
    size: 1400
    vrf: management

Inputs

    
vrf:
    description:
    - Outgoing VRF.
    type: str

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

size:
    description:
    - Size of packets to send.
    type: int

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

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

df_bit:
    default: false
    description:
    - Set the DF bit.
    type: bool

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

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