- Ansible Quick Start Guide
- Mohamed Alibi
- 121字
- 2021-07-23 16:37:47
Ad hoc versus playbook: the ping module
As discussed previously, Ansible ad hoc can be used for a quick check, such as running a ping command to check if the hosts are up and running. The command should look as follows:
ansible servers -m ping
The output of the command will look similar to the following:
The ping module can also be used in the playbook as part of the bigger script, where the result of the ping can be piped to be the condition for another action. The playbook code is as follows:
---
- name: Ping module playbook usage
hosts: servers
gather_facts: false
tasks:
- name: ping the local servers
ping:
The output of this code will look as follows:
推薦閱讀
- 零起步輕松學單片機技術(第2版)
- Hands-On Internet of Things with MQTT
- Visual Basic從初學到精通
- IBM? SmartCloud? Essentials
- Dreamweaver+Photoshop+Flash+Fireworks網站建設與網頁設計完全實用
- MySQL Management and Administration with Navicat
- Hands-On Generative Adversarial Networks with Keras
- 巧學活用Linux
- 系統建模與控制導論
- 百度智能小程序:AI賦能新機遇
- Arduino創意機器人入門:基于ArduBlock(第2版)
- 計算機仿真技術
- 網頁配色萬用寶典
- 華人動畫師的法蘭西印象
- 網絡攻防工具