- 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:
推薦閱讀
- 輕輕松松自動化測試
- Getting Started with Clickteam Fusion
- Hadoop 2.x Administration Cookbook
- 計算機原理
- 計算機控制技術
- 21天學通C++
- JMAG電機電磁仿真分析與實例解析
- 3D Printing for Architects with MakerBot
- 完全掌握AutoCAD 2008中文版:機械篇
- 電氣控制與PLC技術應用
- Docker on Amazon Web Services
- FPGA/CPLD應用技術(Verilog語言版)
- SMS 2003部署與操作深入指南
- Windows安全指南
- Mastering Exploratory Analysis with pandas