add shutdown.yaml

This commit is contained in:
2024-08-29 15:26:24 +08:00
parent b6ccbcde2c
commit ce2e51bf06

9
shutdown.yaml Normal file
View File

@@ -0,0 +1,9 @@
- name: Shutdown remote servers
hosts: all # 或者指定特定的主机组
become: yes # 提升权限为root用户
tasks:
- name: Shutdown the server
command: /sbin/shutdown -h now
async: 1
poll: 0
ignore_errors: true # 忽略错误以防止连接中断后任务失败