add shutdown.yaml
This commit is contained in:
9
shutdown.yaml
Normal file
9
shutdown.yaml
Normal 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 # 忽略错误以防止连接中断后任务失败
|
||||
Reference in New Issue
Block a user