.. _junos_ping: junos_ping - execute ping on junos devices ++++++++++++++++++++++++++++++++++++++++++ :Author: Damien Garros, Juniper Networks .. contents:: :local: :depth: 1 Synopsis -------- .. versionadded:: 1.3.1 execute ping on junos devices Options ------- .. raw:: html
parameter required default choices comments
acceptable_packet_loss no 0
    Number of packets lost that is acceptable to consider the test PASS
    count no 5
      Number of packet to send
      dest_ip yes
        Destination ip
        do_not_fragment no
          Set Don't Fragment bit
          host yes
            Set to {{ inventory_hostname }}
            interface no
              Interface used to send traffic out
              mode no None
                mode of console connection (telnet/serial). If mode is not provided SSH connection is used.
                passwd no assumes ssh-key active
                  Login password
                  port no 830
                    port number to use when connecting to the device
                    rapid no True
                      Execute ping at 100pps instead of 1pps
                      routing_instance no
                        Name of the routing instance to use to send the ping
                        size no None (default size)
                          The size of the ICMP payload of the ping.
                          source_ip no
                            Source IP used to send the ping
                            ssh_private_key_file no None
                              This can be used if you need to provide a private key rather than loading the key into the ssh-key-ring/environment. if your ssh-key requires a password, then you must provide it via **passwd**
                              timeout no 0
                                Extend the NETCONF RPC timeout beyond the default value of 30 seconds. Set this value to accommodate pings that might take longer than the default timeout interval.
                                ttl no
                                  Maximum number of IP routers (IP hops) allowed between source and destination
                                  user no $USER
                                    Login username
                                    .. note:: Requires junos-eznc >= 1.2.2 Examples -------- .. raw:: html
                                    :: # Simple example tasks: - name: "Execute ping peer" junos_ping: host={{ junos_host }} port={{ netconf_port }} user={{ ansible_ssh_user }} passwd={{ ansible_ssh_pass }} dest_ip=8.8.8.8 # ping over console server connection using PyEZ >= 2.0 tasks: - name: "Execute ping peer" junos_ping: host={{ inventory_hostname }} port=2011 mode='telnet' user={{ ansible_ssh_user }} passwd={{ ansible_ssh_pass }} dest_ip=8.8.8.8 # Using loop and more parameters tasks: - name: "Execute ping peer" junos_ping: host={{ junos_host }} port={{ netconf_port }} user={{ ansible_ssh_user }} passwd={{ ansible_ssh_pass }} dest_ip={{ item.peer_ip }} source_ip={{ item.local_ip }} do_not_fragment=True ttl=1 with_items: "{{underlay.neighbors}}"