相关疑难解决方法(0)

在后台远程主机上的ansible run命令

我正在尝试使用ansible在多个主机上启动filebeat(或者就任何其他将按需连续运行的进程)进程.我不希望ansible等到进程继续运行.我希望ansible能够解雇并忘记并出来让远程进程在后台运行.我尝试过使用以下选项:

    ---
    - 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
Run Code Online (Sandbox Code Playgroud)

ansible ansible-playbook

23
推荐指数
1
解决办法
3万
查看次数

标签 统计

ansible ×1

ansible-playbook ×1