ansible - 如何杀死ansible中的异步进程?
问题描述
我有一个在后台运行的进程,我知道这个进程不会过期/结束,如何在一段时间后停止这个进程
- name: put process to background
delegate_to: "{{groups['xxx'][0]}}"
connection: ssh
shell: xxxxx > to_some_file
async: 1000
poll: 0
register: yum_sleeper
vars:
ansible_python_interpreter: /usr/local/bin/python
X 时间后:如何停止此任务或如何捕获它迄今为止捕获的输出?即使将输出重定向到某个文件,它也不会被捕获,因为任务仍在运行
解决方案
推荐阅读
- configuration - 如何将 `0.pool.ntp.org` 放入 `/etc/nftables.conf` 没有任何错误?
- python - 当我添加类型为 varchar(100) 的列时,Pymysql 查询抛出错误
- kubernetes - 当副本数为 1 且 minAvailable 也为 1 时,节点自动缩放器能否自动启动额外的 pod?
- python - 从 sklearn 解释决策树节点的信息
- vue.js - Vue 3 + Vue Router 根页面组件在应用重新初始化时渲染失败
- openlayers - 图中地图上出现奇怪方块是什么原因
- css - 将 html、body、.App 和 #root 设置为 100% 高度后,Div 不会占用剩余空间
- google-sheets - bin2dec 用于 16 位有符号二进制值(在谷歌表中)
- bash - 将当前目录中的文件名列表作为单个字符串发送到 Docker 容器的 STDIN
- events - window.addEventListener('beforeunload', alert) 在 MS 团队自定义反应应用程序中不起作用