Loading... 在常见的web服务中,当配置文件发生修改时,需要进行重启服务。 **剧本** --- - hosts: websrvs remote_user: root tasks: - name: Install Httpd Package yum: name=httpd - name: Httpd config file Copy copy: src=files/httpd.conf dest=/etc/httpd/conf/ backup=yes notify: Restart Httpd #当配置文件发生改变就通知Restrt Httpd - name: Service Start service: name=httpd satte=started enabled=yes handlers: - name: Restart Httpd service: name=httpd state=restarted #收到通知时做出的动作 最后修改:2019 年 10 月 19 日 09 : 23 PM © 允许规范转载 赞赏 如果觉得我的文章对你有用,请随意赞赏 ×Close 赞赏作者 扫一扫支付 支付宝支付 微信支付