Remove a host from a play after meta: end_host (#66851)

* Remove a host from a play after meta: end_host

* Fix changelog
This commit is contained in:
Martin Krizek 2020-02-13 21:35:00 +01:00 committed by GitHub
parent da1bed8932
commit a2c620819f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- "Fix a bug when a host was not removed from a play after ``meta: end_host`` and as a result the host was still present in ``ansible_play_hosts`` and ``ansible_play_batch`` variables."

View file

@ -1094,6 +1094,7 @@ class StrategyBase:
elif meta_action == 'end_host':
if _evaluate_conditional(target_host):
iterator._host_states[target_host.name].run_state = iterator.ITERATING_COMPLETE
iterator._play._removed_hosts.append(target_host.name)
msg = "ending play for %s" % target_host.name
else:
skipped = True