ansible设置串行的方法

ansible作为运维利器十分方便,如果部署服务,尽量用串行比较保险。答案来自 stackoverflow

--

You can use the forks with adhoc command and serial: 1 inside the playbook.

On adhoc command:

ansible aws -a "hostname" --forks=1

Inside the playbook:

- hosts: aws
  become: yes
  gather_facts: yes
  serial: 1
  tasks:
    - YOUR TASKS HERE
posted @ 2017-07-05 11:53  Els0n  阅读(2460)  评论(0编辑  收藏  举报