I implemented a playbook to iterate over 10 hosts. From those 10 hosts, host_2
and host_8
are slow. I used for this setup a batch size of 2. My expected outcome is when the playbook will start with host_1
and host_2
as soon as it finish with host_1
(which is faster), it will grab a host from the next batch instead of waiting for both hosts to finish in order to start with the next batch. Unfortunately using the playbook with host_pinned
strategy which is supposed to work as my expectation, the outcome was the same as free strategy where the next batch will start only when both hosts are finished from the current batch. The outcome is bellow:
PLAY [all] **************************************************************************************************************************************************************************************************************************************************************************
TASK [stop : stop for specific hosts] ***********************************************************************************************************************************************************************************************************************************************
TASK [stop : stop for specific hosts] ***********************************************************************************************************************************************************************************************************************************************
skipping: [host_1]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
skipping: [host_1]
TASK [stop : stop for other hosts] **************************************************************************************************************************************************************************************************************************************************
changed: [host_1 -> localhost]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
ok: [host_1] => {
"msg": "stop host_1 10:57:16.373188889"
}
TASK [update : update] **************************************************************************************************************************************************************************************************************************************************************
changed: [host_1 -> localhost]
TASK [update : debug] ***************************************************************************************************************************************************************************************************************************************************************
ok: [host_1] => {
"msg": "updating host_1 10:57:21.788484077\nupdated host_1 10:57:23.790958603"
}
TASK [start : start] ****************************************************************************************************************************************************************************************************************************************************************
changed: [host_1 -> localhost]
TASK [start : debug] ****************************************************************************************************************************************************************************************************************************************************************
ok: [host_1] => {
"msg": "start host_1 10:57:24.185053675"
}
TASK [start : debug] ****************************************************************************************************************************************************************************************************************************************************************
changed: [host_2 -> localhost]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
ok: [host_2] => {
"msg": "stop host_2 10:57:16.415522282"
}
TASK [stop : stop for other hosts] **************************************************************************************************************************************************************************************************************************************************
skipping: [host_2]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
skipping: [host_2]
TASK [update : update] **************************************************************************************************************************************************************************************************************************************************************
changed: [host_2 -> localhost]
TASK [update : debug] ***************************************************************************************************************************************************************************************************************************************************************
ok: [host_2] => {
"msg": "updating host_2 10:58:17.368744495\nupdated host_2 10:58:19.372907064"
}
TASK [start : start] ****************************************************************************************************************************************************************************************************************************************************************
changed: [host_2 -> localhost]
TASK [start : debug] ****************************************************************************************************************************************************************************************************************************************************************
ok: [host_2] => {
"msg": "start host_2 10:58:19.903162652"
}
PLAY [all] **************************************************************************************************************************************************************************************************************************************************************************
TASK [stop : stop for specific hosts] ***********************************************************************************************************************************************************************************************************************************************
TASK [stop : stop for specific hosts] ***********************************************************************************************************************************************************************************************************************************************
skipping: [host_3]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
skipping: [host_4]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
skipping: [host_3]
TASK [stop : stop for other hosts] **************************************************************************************************************************************************************************************************************************************************
TASK [stop : stop for other hosts] **************************************************************************************************************************************************************************************************************************************************
skipping: [host_4]
TASK [stop : stop for other hosts] **************************************************************************************************************************************************************************************************************************************************
changed: [host_3 -> localhost]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
ok: [host_3] => {
"msg": "stop host_3 10:58:21.214160633"
}
TASK [update : update] **************************************************************************************************************************************************************************************************************************************************************
TASK [update : update] **************************************************************************************************************************************************************************************************************************************************************
changed: [host_4 -> localhost]
TASK [stop : debug] *****************************************************************************************************************************************************************************************************************************************************************
ok: [host_4] => {
"msg": "stop host_4 10:58:21.329958767"
}
TASK [update : update] **************************************************************************************************************************************************************************************************************************************************************
changed: [host_3 -> localhost]
TASK [update : debug] ***************************************************************************************************************************************************************************************************************************************************************
ok: [host_3] => {
"msg": "updating host_3 10:58:26.831347906\nupdated host_3 10:58:28.833336983"
}
TASK [start : start] ****************************************************************************************************************************************************************************************************************************************************************
TASK [start : start] ****************************************************************************************************************************************************************************************************************************************************************
changed: [host_4 -> localhost]
TASK [update : debug] ***************************************************************************************************************************************************************************************************************************************************************
ok: [host_4] => {
"msg": "updating host_4 10:58:26.953679789\nupdated host_4 10:58:28.970638599"
}
TASK [start : start] ****************************************************************************************************************************************************************************************************************************************************************
changed: [host_3 -> localhost]
TASK [start : debug] ****************************************************************************************************************************************************************************************************************************************************************
ok: [host_3] => {
"msg": "start host_3 10:58:29.662201166"
}
TASK [start : debug] ****************************************************************************************************************************************************************************************************************************************************************
changed: [host_4 -> localhost]
TASK [start : debug] ****************************************************************************************************************************************************************************************************************************************************************
ok: [host_4] => {
"msg": "start host_4 10:58:29.801761229"
}
Did I misunderstood the host_pinned strategy? Can you give me some guidance in how to implement my approach using Ansible?