awcrosby.cisco_ios_test.ios_ping (1.0.10) — module

Tests reachability using ping from Cisco IOS network devices

| "added in version" 1.0.0 of awcrosby.cisco_ios_test"

Authors: Jacob McGill (@jmcgill298)

Install collection

Install with ansible-galaxy collection install awcrosby.cisco_ios_test:==1.0.10


Add to requirements.yml

  collections:
    - name: awcrosby.cisco_ios_test
      version: 1.0.10

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
  cisco.ios.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
  cisco.ios.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
  cisco.ios.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
  cisco.ios.ios_ping:
    dest: 10.40.40.40
    source: loopback0
    vrf: prod
    count: 20

Inputs

    
vrf:
    description:
    - The VRF to use for forwarding.
    type: str

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

count:
    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

source:
    description:
    - The source IP Address.
    type: str

provider:
    description:
    - B(Deprecated)
    - 'Starting with Ansible 2.5 we recommend using C(connection: network_cli).'
    - For more information please see the L(IOS Platform Options guide, ../network/user_guide/platform_ios.html).
    - HORIZONTALLINE
    - A dict object containing connection details.
    suboptions:
      auth_pass:
        description:
        - Specifies the password to use if required to enter privileged mode on the remote
          device.  If I(authorize) is false, then this argument does nothing. If the value
          is not specified in the task, the value of environment variable C(ANSIBLE_NET_AUTH_PASS)
          will be used instead.
        type: str
      authorize:
        default: false
        description:
        - Instructs the module to enter privileged mode on the remote device before sending
          any commands.  If not specified, the device will attempt to execute all commands
          in non-privileged mode. If the value is not specified in the task, the value
          of environment variable C(ANSIBLE_NET_AUTHORIZE) will be used instead.
        type: bool
      host:
        description:
        - Specifies the DNS host name or address for connecting to the remote device over
          the specified transport.  The value of host is used as the destination address
          for the transport.
        type: str
      password:
        description:
        - Specifies the password to use to authenticate the connection to the remote device.   This
          value is used to authenticate the SSH session. If the value is not specified
          in the task, the value of environment variable C(ANSIBLE_NET_PASSWORD) will
          be used instead.
        type: str
      port:
        description:
        - Specifies the port to use when building the connection to the remote device.
        type: int
      ssh_keyfile:
        description:
        - Specifies the SSH key to use to authenticate the connection to the remote device.   This
          value is the path to the key used to authenticate the SSH session. If the value
          is not specified in the task, the value of environment variable C(ANSIBLE_NET_SSH_KEYFILE)
          will be used instead.
        type: path
      timeout:
        description:
        - Specifies the timeout in seconds for communicating with the network device for
          either connecting or sending commands.  If the timeout is exceeded before the
          operation is completed, the module will error.
        type: int
      username:
        description:
        - Configures the username to use to authenticate the connection to the remote
          device.  This value is used to authenticate the SSH session. If the value is
          not specified in the task, the value of environment variable C(ANSIBLE_NET_USERNAME)
          will be used instead.
        type: str
    type: dict

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