posted by 귀염둥이채원 2019. 1. 29. 18:19

Ansible은 기본적으로 play를 병렬로 실행한다.

Rolling Update를 수행하려면 serial 키워드를 사용하면 된다.


serial 키워드는 한 번에 얼마나 많은 서버에 명령을 수행할지 알려줍니다.

serial 키워드를 지정하지 않으면 구성 파일에 지정된 기본 fork 한도까지 병렬 처리합니다.


serial keyword를 이용한 rolling update

 - name: test play

  hosts: webservers

  serial: 1

  gather_facts: False

  tasks:

  - name: task one

    comand: hostname

  - name: task two

    command: hostname


# 참고 사이트

https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html

https://stackoverflow.com/questions/27315469/ansible-how-to-sequentially-execute-playbook-for-each-host



'Tool > ansible' 카테고리의 다른 글

ansible role template 생성하기  (0) 2019.02.01
ansible handler란?  (0) 2019.02.01
ansible-vault를 이용한 암호화  (0) 2019.01.29
ansible source build  (0) 2019.01.29
fail module 사용법 정리  (0) 2019.01.29