ansible.builtin.ios_ping (v2.9.24) — module

Tests reachability using ping from Cisco IOS network devices

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

Authors: Jacob McGill (@jmcgill298)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.24

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 10.10.10.10 using default vrf
  ios_ping:
    dest: 10.10.10.10
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 10.20.20.20 using prod vrf
  ios_ping:
    dest: 10.20.20.20
    vrf: prod
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test unreachability to 10.30.30.30 using default vrf
  ios_ping:
    dest: 10.30.30.30
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Test reachability to 10.40.40.40 using prod vrf and setting count and source
  ios_ping:
    dest: 10.40.40.40
    source: loopback0
    vrf: prod
    count: 20

Inputs

    
vrf:
    default: default
    description:
    - The VRF to use for forwarding.

dest:
    description:
    - The IP Address or hostname (resolvable by switch) of the 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:
    - The source IP Address.

Outputs

commands:
  description: Show the command sent.
  returned: always
  sample:
  - ping vrf prod 10.40.40.40 count 20 source loopback0
  type: list
packet_loss:
  description: Percentage of packets lost.
  returned: always
  sample: 0%
  type: str
packets_rx:
  description: Packets successfully received.
  returned: always
  sample: 20
  type: int
packets_tx:
  description: Packets successfully transmitted.
  returned: always
  sample: 20
  type: int
rtt:
  description: Show RTT stats.
  returned: always
  sample:
    avg: 2
    max: 8
    min: 1
  type: dict