YAML_11 when条件判断
生活随笔
收集整理的這篇文章主要介紹了
YAML_11 when条件判断
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
當系統負載超過0.7時,則關掉httpd ansible]# vim when.yml --- - hosts: cache remote_user: root tasks: - shell: uptime | awk '{printf("%.2f",$(NF-2))}' register: result - service: name: httpd state: stopped when: result.stdout|float < 0.7 (此處寫<,方便查看效果) ansible]# ansible-playbook when.yml
轉載于:https://www.cnblogs.com/luwei0915/p/10615570.html
總結
以上是生活随笔為你收集整理的YAML_11 when条件判断的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: js获取数组前n项的和
- 下一篇: N - Dragon Balls(并查集