����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# -*- coding: utf-8 -*-
# Copyright 2022 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
module: ios_ping
short_description: Tests reachability using ping from IOS switch.
description:
- Tests reachability using ping from switch to a remote destination.
- For a general purpose network module, see the L(net_ping,https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/net_ping_module.html)
module.
- For Windows targets, use the L(win_ping,https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_ping_module.html)
module instead.
- For targets running Python, use the L(ping,https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ping_module.html)
module instead.
version_added: 1.0.0
author:
- Jacob McGill (@jmcgill298)
- Sagar Paul (@KB-perByte)
options:
count:
description:
- Number of packets to send.
type: int
afi:
description:
- Define echo type ip or ipv6.
choices:
- ip
- ipv6
default: ip
type: str
dest:
description:
- The IP Address or hostname (resolvable by switch) of the remote node.
required: true
type: str
df_bit:
description:
- Set the DF bit.
default: false
type: bool
source:
description:
- The source IP Address.
type: str
egress:
description:
- Force egress interface bypassing routing.
type: str
ingress:
description:
- LAN source interface for Ingress.
type: str
timeout:
description:
- specify timeout interval.
type: int
state:
description:
- Determines if the expected result is success or fail.
choices:
- absent
- present
default: present
type: str
vrf:
description:
- The VRF to use for forwarding.
type: str
notes:
- Tested against Cisco IOSXE Version 17.3 on CML.
- For a general purpose network module, see the L(net_ping,https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/net_ping_module.html)
module.
- For Windows targets, use the L(win_ping,https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_ping_module.html)
module instead.
- For targets running Python, use the L(ping,https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ping_module.html) module instead.
"""
EXAMPLES = """
- name: Test reachability to 198.51.100.251 using default vrf
cisco.ios.ios_ping:
dest: 198.51.100.251
- name: Test reachability to 198.51.100.252 using prod vrf
cisco.ios.ios_ping:
dest: 198.51.100.252
vrf: prod
afi: ip
- name: Test un reachability to 198.51.100.253 using default vrf
cisco.ios.ios_ping:
dest: 198.51.100.253
state: absent
- name: Test reachability to 198.51.100.250 using prod vrf and setting count and source
cisco.ios.ios_ping:
dest: 198.51.100.250
source: loopback0
vrf: prod
count: 20
- name: Test reachability to 198.51.100.249 using df-bit and size
cisco.ios.ios_ping:
dest: 198.51.100.249
df_bit: true
size: 1400
- name: Test reachability to ipv6 address
cisco.ios.ios_ping:
dest: 2001:db8:ffff:ffff:ffff:ffff:ffff:ffff
afi: ipv6
"""
RETURN = """
commands:
description: Show the command sent.
returned: always
type: list
sample: ["ping vrf prod 198.51.100.251 count 20 source loopback0"]
packet_loss:
description: Percentage of packets lost.
returned: always
type: str
sample: "0%"
packets_rx:
description: Packets successfully received.
returned: always
type: int
sample: 20
packets_tx:
description: Packets successfully transmitted.
returned: always
type: int
sample: 20
rtt:
description: Show RTT stats.
returned: always
type: dict
sample: {"avg": 2, "max": 8, "min": 1}
"""
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.cisco.ios.plugins.module_utils.network.ios.argspec.ping.ping import (
PingArgs,
)
from ansible_collections.cisco.ios.plugins.module_utils.network.ios.config.ping.ping import Ping
def main():
"""
Main entry point for module execution
:returns: the result form module invocation
"""
module = AnsibleModule(argument_spec=PingArgs.argument_spec)
result = Ping(module).execute_module()
module.exit_json(**result)
if __name__ == "__main__":
main()
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| ios_acl_interfaces.py | File | 17.59 KB | 0644 |
|
| ios_acls.py | File | 54.73 KB | 0644 |
|
| ios_banner.py | File | 6.14 KB | 0644 |
|
| ios_bgp.py | File | 16.55 KB | 0644 |
|
| ios_bgp_address_family.py | File | 102.57 KB | 0644 |
|
| ios_bgp_global.py | File | 100.12 KB | 0644 |
|
| ios_command.py | File | 14.23 KB | 0644 |
|
| ios_config.py | File | 23.18 KB | 0644 |
|
| ios_facts.py | File | 8.06 KB | 0644 |
|
| ios_hostname.py | File | 8.03 KB | 0644 |
|
| ios_interfaces.py | File | 25.09 KB | 0644 |
|
| ios_l2_interfaces.py | File | 19.36 KB | 0644 |
|
| ios_l3_interfaces.py | File | 23.98 KB | 0644 |
|
| ios_lacp.py | File | 6.94 KB | 0644 |
|
| ios_lacp_interfaces.py | File | 13.45 KB | 0644 |
|
| ios_lag_interfaces.py | File | 16.56 KB | 0644 |
|
| ios_linkagg.py | File | 10.8 KB | 0644 |
|
| ios_lldp.py | File | 3.29 KB | 0644 |
|
| ios_lldp_global.py | File | 10.17 KB | 0644 |
|
| ios_lldp_interfaces.py | File | 15.68 KB | 0644 |
|
| ios_logging.py | File | 14.92 KB | 0644 |
|
| ios_logging_global.py | File | 29.57 KB | 0644 |
|
| ios_ntp.py | File | 10.31 KB | 0644 |
|
| ios_ntp_global.py | File | 30.06 KB | 0644 |
|
| ios_ospf_interfaces.py | File | 34.33 KB | 0644 |
|
| ios_ospfv2.py | File | 59.75 KB | 0644 |
|
| ios_ospfv3.py | File | 72.73 KB | 0644 |
|
| ios_ping.py | File | 4.41 KB | 0644 |
|
| ios_prefix_lists.py | File | 32.05 KB | 0644 |
|
| ios_route_maps.py | File | 83.28 KB | 0644 |
|
| ios_service.py | File | 17.82 KB | 0644 |
|
| ios_snmp_server.py | File | 67.16 KB | 0644 |
|
| ios_static_routes.py | File | 30.87 KB | 0644 |
|
| ios_system.py | File | 11.96 KB | 0644 |
|
| ios_user.py | File | 20.1 KB | 0644 |
|
| ios_vlans.py | File | 30.29 KB | 0644 |
|
| ios_vrf.py | File | 25.62 KB | 0644 |
|