diff --git a/zuul/ansible/callback/zuul_stream.py b/zuul/ansible/callback/zuul_stream.py
index d794ce7..c4473da 100644
--- a/zuul/ansible/callback/zuul_stream.py
+++ b/zuul/ansible/callback/zuul_stream.py
@@ -150,14 +150,29 @@
     def v2_playbook_on_start(self, playbook):
         self._playbook_name = os.path.splitext(playbook._file_name)[0]
 
+    def v2_playbook_on_include(self, included_file):
+        for host in included_file._hosts:
+            self._log("{host} | included: {filename}".format(
+                host=host.name,
+                filename=included_file._filename))
+
     def v2_playbook_on_play_start(self, play):
         self._play = play
+        # Get the hostvars from just one host - the vars we're looking for will
+        # be identical on all of them
+        hostvars = self._play._variable_manager._hostvars
+        a_host = hostvars.keys()[0]
+        self.phase = hostvars[a_host]['zuul_execution_phase']
+        if self.phase != 'run':
+            self.phase = '{phase}-{index}'.format(
+                phase=self.phase,
+                index=hostvars[a_host]['zuul_execution_phase_index'])
+
+        # the name of a play defaults to the hosts string
         name = play.get_name().strip()
-        if not name:
-            msg = u"PLAY"
-        else:
-            msg = u"PLAY [{playbook} : {name}]".format(
-                playbook=self._playbook_name, name=name)
+        msg = u"PLAY [{phase} : {playbook} : {name}]".format(
+            phase=self.phase,
+            playbook=self._playbook_name, name=name)
 
         self._log(msg)
         # Log an extra blank line to get space after each play
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index bc30386..3530f39 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -883,10 +883,10 @@
         result = None
 
         pre_failed = False
-        for count, playbook in enumerate(self.jobdir.pre_playbooks):
+        for index, playbook in enumerate(self.jobdir.pre_playbooks):
             # TODOv3(pabelanger): Implement pre-run timeout setting.
             pre_status, pre_code = self.runAnsiblePlaybook(
-                playbook, args['timeout'], phase='pre', count=count)
+                playbook, args['timeout'], phase='pre', index=index)
             if pre_status != self.RESULT_NORMAL or pre_code != 0:
                 # These should really never fail, so return None and have
                 # zuul try again
@@ -912,10 +912,10 @@
             else:
                 result = 'FAILURE'
 
-        for count, playbook in enumerate(self.jobdir.post_playbooks):
+        for index, playbook in enumerate(self.jobdir.post_playbooks):
             # TODOv3(pabelanger): Implement post-run timeout setting.
             post_status, post_code = self.runAnsiblePlaybook(
-                playbook, args['timeout'], success, phase='post', count=count)
+                playbook, args['timeout'], success, phase='post', index=index)
             if post_status != self.RESULT_NORMAL or post_code != 0:
                 # If we encountered a pre-failure, that takes
                 # precedence over the post result.
@@ -1373,7 +1373,7 @@
         return (self.RESULT_NORMAL, ret)
 
     def runAnsiblePlaybook(self, playbook, timeout, success=None,
-                           phase=None, count=None):
+                           phase=None, index=None):
         env_copy = os.environ.copy()
         env_copy['LOGNAME'] = 'zuul'
 
@@ -1390,8 +1390,8 @@
         if phase:
             cmd.extend(['-e', 'zuul_execution_phase=%s' % phase])
 
-        if count is not None:
-            cmd.extend(['-e', 'zuul_execution_phase_count=%s' % count])
+        if index is not None:
+            cmd.extend(['-e', 'zuul_execution_phase_index=%s' % index])
 
         result, code = self.runAnsible(
             cmd=cmd, timeout=timeout, trusted=playbook.trusted)
