后台远程主机上的ansible run命令 [英] ansible run command on remote host in background
本文介绍了后台远程主机上的ansible run命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用ansible在多个主机上启动filebeat(或就此而言将按需连续运行的任何其他进程)进程.我不想ansible等到进程继续运行.我希望ansible开火并忘记,然后出来并保持远程进程在后台运行. 我尝试使用以下选项:
I am trying to start filebeat (or for that matter any other process which will run continuously on demand) process on multiple hosts using ansible. I don't want ansible to wait till the process keeps on running. I want ansible to fire and forget and come out and keep remote process running in back ground. I've tried using below options:
---
- hosts: filebeat
tasks:
- name: start filebeat
option a) command: filebeat -c filebeat.yml &
option b) command: nohup filebeat -c filebeat.yml &
option c) shell: filebeat -c filebeat.yml &
async: 0 //Tried without as well. If its > 0 then it only waits for that much of time and terminates the filebeat process on remote host and comes out.
poll: 0
推荐答案
查看全文