linux - 检查引导过程后操作系统是否启动
问题描述
我使用 racadm 命令启动和使用 RHEL7 的新节点
此操作系统启动是其他自动化的一部分(第一步)
我使用 ansible 进行整个自动化,但我现在基本上使用这段代码
- name: Test if the OS is up
shell: |
until ssh -q -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null user@10.10.10.10 exit; do sleep 30; done
echo Node node is up!
但这不会在节点启动后立即发生,因为没有用户“用户”我需要一些命令,如 ping 或任何其他方法来测试节点是否启动,任何建议都非常感谢。
解决方案
您可以使用 ansiblewait_for_connection
模块 - 等待远程系统可访问。请在此处查看文档
https://docs.ansible.com/ansible/latest/modules/wait_for_connection_module.html
该模块利用内部 ansible 传输(和配置)和 ping/win_ping 模块来保证正确的端到端功能
推荐阅读
- c - Realloc 现有数据正在丢失
- python - 如何在整个熊猫列上应用 json_normalize
- ruby-on-rails - 活动存储 - 带有 URL 或路径的原始文件扩展名
- c++ - 我如何从 C++ 中操作 csv
- i2c - 与 Wire.h(ESP32) 的 I2C 通信
- python-3.x - 我应该使用循环还是坚持使用嵌套的 if 语句?
- python - 如何使用数据框拆分新列中的两个 CSV 文件列,在熊猫中显示匹配项?
- c++ - C ++如何抛弃函数的虚拟性并调用基函数,而不是重写
- java - 块末尾的意外内容 - 是什么构建了损坏的流?
- python - 我如何获得水平小提琴图或箱线图?(在 hvplot 全息视图中默认为垂直)