ansible - 在树莓派上进行 ansible Ping 测试
问题描述
我正在寻找一个可以使用蜂窝接口 ping 并测试响应的 ansible 模块。
我在我的树莓派上运行它作为蜂窝连接的验证。
相当于
ping -I wwan0 google.com
我找不到以简单方式执行此操作或根本无法执行此操作的模块。
解决方案
有一个ping
模块,但它没有将源接口 ( -I
) 作为参数。使用command
模块怎么样?
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/command_module.html
像这样简单的东西:
- name: Ping google.com from interface wwan0
ansible.builtin.command: ping -I wwan0 google.com
推荐阅读
- react-testing-library - react-testing-library 中的选择器,可以通过 getAllByText 检索多个匹配项
- c++ - 有哪些足够好的方法可以将对象(数据包)插入二叉搜索树?
- reactjs - 使用 Apache 时,React 应用程序显示“404 找不到请求的路径”页面
- r - 如何修复 S-plus 中的线性模型拟合误差
- excel - 如何将变量从函数传递给子函数?
- typescript - 'as const' 与类型相结合?
- excel - 数据验证不会保存
- javascript - 如何正确利用 `.reduce` 来计算数组中的字符总数?
- arrays - AngularJS ng-repeat 和 indexOf() 检查对象
- java - 不明白这些位运算符如何对字节和整数进行操作