You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently host lists are fully deduped in order to prevent unwanted duplicity when merging different host list sources. E.g. specifying a role containing host1and at the same time also using a @hosts('host1') decorator would, without deduping, run twice on host1, which is not usually the desired effect.
However, this protective feature disables any wanted duplicity, i.e. running a task multiple times on the same server on purpose. (This has become especially important for some folks with the advent of parallelism.)
I see two solutions:
Simply add another global option that is tested in the host merging method (currently Task.get_hosts IIRC) and if set, does not do any deduping, but simply adds all sources together.
Simplest/easiest, fills the need, while staying off by default to protect newbies from unexpected/odd behavior.
Try to be "smart" and dedupe inter-source but not intra-source, i.e. two examples of the same host string from two different sources (say, -H and @hosts) would get deduped, but identical host strings in the same source (e.g. env.hosts = ['host1', 'host1', 'host1']) would not get deduped.
Harder to implement, but "cleaner", in that it would not require an option to be activated, and instead would try to determine what the user's actual intent was.
I don't see any serious downsides to going with the simpler approach. Users wanting this feature are more likely to be advanced enough that they know to search for and activate nondefault options; and they're also more likely to understand the tradeoff and/or not specify multiple sources simultaneously.
The text was updated successfully, but these errors were encountered:
Currently host lists are fully deduped in order to prevent unwanted duplicity when merging different host list sources. E.g. specifying a role containing
host1
and at the same time also using a@hosts('host1')
decorator would, without deduping, run twice onhost1
, which is not usually the desired effect.However, this protective feature disables any wanted duplicity, i.e. running a task multiple times on the same server on purpose. (This has become especially important for some folks with the advent of parallelism.)
I see two solutions:
Task.get_hosts
IIRC) and if set, does not do any deduping, but simply adds all sources together.-H
and@hosts
) would get deduped, but identical host strings in the same source (e.g.env.hosts = ['host1', 'host1', 'host1']
) would not get deduped.I don't see any serious downsides to going with the simpler approach. Users wanting this feature are more likely to be advanced enough that they know to search for and activate nondefault options; and they're also more likely to understand the tradeoff and/or not specify multiple sources simultaneously.
The text was updated successfully, but these errors were encountered: