Debian Codegraph @

lib/ansible/plugins/strategy/host_pinned.py

raw
1 # (c) 2012-2014, Michael DeHaan <[email protected]>
2 #
3 # This file is part of Ansible
4 #
5 # Ansible is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # Ansible is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
17 from __future__ import annotations
18
19 DOCUMENTATION = """
20 name: host_pinned
21 short_description: Executes tasks on each host without interruption
22 description:
23 - Task execution is as fast as possible per host in batch as defined by C(serial) (default all).
24 Ansible will not start a play for a host unless the play can be finished without interruption by tasks for another host,
25 i.e. the number of hosts with an active play does not exceed the number of forks.
26 Ansible will not wait for other hosts to finish the current task before queuing the next task for a host that has finished.
27 Once a host is done with the play, it opens it's slot to a new host that was waiting to start.
28 Other than that, it behaves just like the "free" strategy.
29 version_added: "2.7"
30 author: Ansible Core Team
31 """
32
33 from ansible.plugins.strategy.free import StrategyModule as FreeStrategyModule
34 from ansible.utils.display import Display
35
36 display = Display()
37
38
39 class StrategyModule(FreeStrategyModule):
40
41 def __init__(self, tqm):
42 super(StrategyModule, self).__init__(tqm)
43 self._host_pinned = True