The question generally arose from the fact that when cloning large repositories I see that the order of output to the screen changes.
Well, not to be unfounded - a specific example for ansible 2.1
Data set:
repositories: mediawiki_core1: repo: https://gerrit.wikimedia.org/r/p/mediawiki/core.git path: w1 mediawiki_core2: repo: https://gerrit.wikimedia.org/r/p/mediawiki/core.git path: w2 version: REL1_25 mediawiki_core3: repo: https://gerrit.wikimedia.org/r/p/mediawiki/core.git path: w3 Handler:
- name: clone repositories git: repo: "{{ item.value.repo }}" dest: "/root/tests/{{ item.value.path }}/" version: "{{ item.value.version | default('HEAD') }}" become: true become_user: apache with_dict: "{{ repositories }}" The conclusion would be:
TASK [abcdef: clone repositories]
changed: [server.domain.ru] => (item = {'value': {u'repo ': u' https://gerrit.wikimedia.org/r/p/mediawiki/core.git ', u' path ': u'w1'}, 'key': u'mediawiki_core1 '})
changed: [server.domain.ru] => (item = {'value': {u'repo ': u' https://gerrit.wikimedia.org/r/p/mediawiki/core.git ', u' path ': u'w3'}, 'key': u'mediawiki_core3 '})
changed: [server.domain.ru] => (item = {'value': {u'repo ': u' https://gerrit.wikimedia.org/r/p/mediawiki/core.git ', u' path ': u'w2', u'version ': u'REL1_25'}, 'key': u'mediawiki_core2 '})
It is necessary to do so in order to guarantee the successive execution of tasks one after another, regardless of how long it takes to complete.
A typical example: after a wiki engine is cloned (a very lengthy task), you can start cloning many small repositories with screenshots and extensions.
Additionally, I want to put things in order in my head and figure out how to manage the order of execution in order to be able to parallelize tasks, if necessary, but if you need to ensure that tasks are performed one after another in the specified order, then be able to perform them sequentially.
PS What's the strangest thing: exactly in the above example, the problem with the order arises, but when you launch different repositories (the first is heavy mediawiki, the second is a small own repository), the problem ceases to play: first the first task runs for a long time, then the second quickly flies by. I don’t believe in mysticism: it simply speaks of misunderstanding how it all works under the hood.