I read this two ansible docs:
ansible-playbook -f --> Statement 1
ansible-playbook :serial --> Statement 2
and I found this two statements:
-f <FORKS>, --forks <FORKS>
specify number of parallel processes to use (default=5)
Rolling Update Batch Size. By default, Ansible will try to manage all of the machines referenced in a play in parallel. For a rolling update use case, you can define how many hosts Ansible should manage at a single time by using the serial keyword:
What's correct? Does ansible uses all hosts at once or just 5?
Or is maybe 5 just the default value of the -f
parameter?
Thanks for clarifying that!
Cheers
--forks
sets number of hosts on which the current task is executed simultaneously (see Ansible Configuration Settings)
serial
sets number (or percentage/fraction) of hosts on which the playbook is run first, and after succesful completion, it is applied on another number of hosts (see Delegation, Rolling Updates, and Local Actions)
With settings:
host[1-7]
--fork 2
serial: 3
The procedure is:
task1
on host1
and host2
task1
on host3
task2
on host1
and host2
task2
on host3
host[1-3]
task1
on host4
and host5
task1
on host6
task2
on host4
and host5
task2
on host6
host[4-6]
task1
on host7
task2
on host7
host7
Because:
--fork
)serial
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With