From 59d5892fa38b4f762621dacf6052aa3331e714a4 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Sat, 25 Jan 2014 18:43:15 -0500 Subject: [PATCH] added new play_hosts var this variable has the 'current host list' to be executed over in the play. Useful when using --limit to not iterate over hosts not included in play in templates or with_items. Signed-off-by: Brian Coca --- lib/ansible/playbook/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/playbook/__init__.py b/lib/ansible/playbook/__init__.py index 24e78053228..9058d3ec65e 100644 --- a/lib/ansible/playbook/__init__.py +++ b/lib/ansible/playbook/__init__.py @@ -346,6 +346,8 @@ class PlayBook(object): run_hosts=hosts ) + runner.module_vars.update({'play_hosts': hosts}) + if task.async_seconds == 0: results = runner.run() else: