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