简体   繁体   English

ansible-playbook执行顺序

[英]ansible-playbook Execution order

This yml file is mainly used to install mysql, but I found that the yml file execution order is a bit strange. 这个yml文件主要用于安装mysql,但是我发现yml文件的执行顺序有点奇怪。

Why is the handler implementation later than the restart mysqld task? 为什么处理程序实现晚于重启mysqld任务? why? 为什么?

enter image description here 在此处输入图片说明

enter image description here 在此处输入图片说明

You haven't posted the complete code. 您尚未发布完整的代码。 Handler section is missing. 缺少处理程序部分。 You might want to find out where does the "Reload service" handler come from. 您可能想找出“重新加载服务” 处理程序来自何处。

To answer your question 回答你的问题

Why is the handler implementation later than the restart mysqld task? 为什么处理程序实现晚于重启mysqld任务?

The documentation is clear about it 文档很清楚

These 'notify' actions are triggered at the end of each block of tasks in a play, and will only be triggered once even if notified by multiple different tasks. 这些“通知”动作在播放中每个任务块的结尾处触发,即使被多个不同的任务通知,也只会触发一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM