从Ansible Playbook内部无法访问的主机中恢复(Recover From Host Unreachable Inside Ansible Playbook)

系统教程 行业动态 更新时间:2024-06-14 16:57:18
从Ansible Playbook内部无法访问的主机中恢复(Recover From Host Unreachable Inside Ansible Playbook)

我有一个Ansible操作手册,用于自动备份服务器和数据库(都在同一个虚拟机上)。

昨天晚上,在剧本运行的中间,rsync遇到了主机不可达错误,剧本失败。 我不知道在主机无法访问的情况下,块的“救援”部分将不会执行。 这导致救援不能运行,我们备份的服务没有上线,这意味着许多人在上午无法工作。

我正在寻找一种方法来捕获主机无法访问的错误,如“failed_when”,这样我就可以执行任务来启动服务,以避免再次发生这种情况。

有没有人有任何想法?

I have an Ansible playbook that is used to automate the backup of a server and database (both on the same VM).

Last night during the middle of the playbook's run, rsync ran into a host unreachable error and the playbook failed. I was unaware that the "rescue" part of the blocks will not be executed in the case of a host unreachable. This caused the rescue to not be run and the service we were backing up did not come online, meaning that many people were unable to do work in the morning.

I'm looking for a way to catch the host unreachable error within something like a "failed_when" so that I can execute a task to start the service in the off chance that this happens again.

Does anyone have any ideas?

最满意答案

截至目前,Ansible无法实现。 这是一个已知的问题 。

As of right now this is not possible with Ansible. It is a known issue.

更多推荐

本文发布于:2023-04-12 20:35:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/6cc133d863b0f5f513bb4b3514b14a1b.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法访问   主机   Playbook   Ansible   Host

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!