且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

修复剧本中的错误后如何继续执行失败的任务?

更新时间:2023-11-23 16:04:10

看一看 执行故障排除手册.如果您想在特定任务上开始执行您的剧本,您可以使用 --start-at-task 选项:

Take a look at Executing playbooks for troubleshooting. If you want to start executing your playbook at a particular task, you can do so with the --start-at-task option:

ansible-playbook playbook.yml --start-at-task="install packages"

以上将在名为安装包"的任务中开始执行您的剧本.

The above will start executing your playbook at a task named "install packages".

或者,看看这个以前的答案 如何在 ansible playbook 中只运行一项任务?

Alternatively, take a look at this previous answer How to run only one task in ansible playbook?

最后,当一个游戏失败时,它通常会给你一些类似的东西:

Finally, when a play fails, it usually gives you something along the lines of:

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/user/site.retry

使用那个 --limit 命令,它应该从失败的任务中重试.

Use that --limit command and it should retry from the failed task.