ansible 之 ping

ping

用途:检查主机存货

官方文档

[root@ansible ~]# ansible-doc ping
> PING    (/usr/lib/python2.7/site-packages/ansible-2.8.0.dev0-py2.7.egg/ansible/modules/system/ping.py)

        A trivial test module, this module always returns `pong' on successful contact.
        It does not make sense in playbooks, but it is useful from `/usr/bin/ansible' to
        verify the ability to login and that a usable Python is configured. This is NOT
        ICMP ping, this is just a trivial test module that requires Python on the
        remote-node. For Windows targets, use the [win_ping] module instead. For Network
        targets, use the [net_ping] module instead.

  * This module is maintained by The Ansible Core Team
OPTIONS (= is mandatory):

- data
        Data to return for the `ping' return value.
        If this parameter is set to `crash', the module will cause an exception.
        [Default: pong]


NOTES:
      * For Windows targets, use the [win_ping] module instead.
      * For Network targets, use the [net_ping] module instead.

AUTHOR: Ansible Core Team, Michael DeHaan
        METADATA:
          status:
          - stableinterface
          supported_by: core
        

EXAMPLES:
# Test we can logon to 'webservers' and execute python with json lib.
# ansible webservers -m ping

# Example from an Ansible Playbook
- ping:

# Induce an exception to see what happens
- ping:
    data: crash

RETURN VALUES:


ping:
    description: value provided with the data parameter
    returned: success
    type: string
    sample: pong

参数解释

  • data
    默认值:ping
posted @ 2018-12-06 15:04  McSiberiaWolf  阅读(1817)  评论(0编辑  收藏  举报