当系统负载超过0.7时,则关掉httpd
--- - 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