{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/244804544","pull_request_review_id":188765606,"id":244804544,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDgwNDU0NA==","diff_hunk":"@@ -469,10 +469,12 @@ def search_handler_blocks_by_name(handler_name, handler_blocks):\n                         self._tqm._failed_hosts[original_host.name] = True\n \n                     if state and iterator.get_active_state(state).run_state == iterator.ITERATING_RESCUE:\n+                        original_task_vars = self._variable_manager.get_vars(play=iterator._play, task=original_task)\n+                        templar = Templar(loader=self._loader, variables=original_task_vars)\n                         self._variable_manager.set_nonpersistent_facts(\n                             original_host,\n                             dict(\n-                                ansible_failed_task=original_task.serialize(),\n+                                ansible_failed_task=templar.template(original_task.serialize()),","path":"lib/ansible/plugins/strategy/__init__.py","position":10,"original_position":10,"commit_id":"e6f0969692508dd6b1e2e28beb3920645a96e37d","original_commit_id":"e6f0969692508dd6b1e2e28beb3920645a96e37d","user":{"login":"bcoca","id":836171,"node_id":"MDQ6VXNlcjgzNjE3MQ==","avatar_url":"https://avatars1.githubusercontent.com/u/836171?v=4","gravatar_id":"","url":"https://api.github.com/users/bcoca","html_url":"https://github.com/bcoca","followers_url":"https://api.github.com/users/bcoca/followers","following_url":"https://api.github.com/users/bcoca/following{/other_user}","gists_url":"https://api.github.com/users/bcoca/gists{/gist_id}","starred_url":"https://api.github.com/users/bcoca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcoca/subscriptions","organizations_url":"https://api.github.com/users/bcoca/orgs","repos_url":"https://api.github.com/users/bcoca/repos","events_url":"https://api.github.com/users/bcoca/events{/privacy}","received_events_url":"https://api.github.com/users/bcoca/received_events","type":"User","site_admin":false},"body":"this can also create divergences since the task itself might have changed variables it originally used:\r\n\r\n``` set_fact: myvar={{ myvar +1 }}```","created_at":"2019-01-02T17:53:56Z","updated_at":"2019-01-02T17:53:57Z","html_url":"https://github.com/ansible/ansible/pull/50459#discussion_r244804544","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/50459","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/244804544"},"html":{"href":"https://github.com/ansible/ansible/pull/50459#discussion_r244804544"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/50459"}},"in_reply_to_id":244804097},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/50459","id":241803039,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxODAzMDM5","html_url":"https://github.com/ansible/ansible/pull/50459","diff_url":"https://github.com/ansible/ansible/pull/50459.diff","patch_url":"https://github.com/ansible/ansible/pull/50459.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/50459","number":50459,"state":"open","locked":false,"title":"Template ansible_failed_task earlier","user":{"login":"mkrizek","id":1215518,"node_id":"MDQ6VXNlcjEyMTU1MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1215518?v=4","gravatar_id":"","url":"https://api.github.com/users/mkrizek","html_url":"https://github.com/mkrizek","followers_url":"https://api.github.com/users/mkrizek/followers","following_url":"https://api.github.com/users/mkrizek/following{/other_user}","gists_url":"https://api.github.com/users/mkrizek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkrizek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkrizek/subscriptions","organizations_url":"https://api.github.com/users/mkrizek/orgs","repos_url":"https://api.github.com/users/mkrizek/repos","events_url":"https://api.github.com/users/mkrizek/events{/privacy}","received_events_url":"https://api.github.com/users/mkrizek/received_events","type":"User","site_admin":false},"body":"##### SUMMARY\r\n<!--- Describe the change below, including rationale and design decisions -->\r\nTemplate ``ansible_failed_task`` at the time of the failure when the variables are still provided.\r\n\r\nFixes #49942\r\n<!--- HINT: Include \"Fixes #nnn\" if you are fixing an existing issue -->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest -->\r\n- Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Write the short name of the module, plugin, task or feature below -->\r\nstrategy\r\n","created_at":"2019-01-02T17:27:14Z","updated_at":"2019-01-02T17:53:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"be2230b55b47bfb1e24c4932842500c063a1cd84","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1043397454,"node_id":"MDU6TGFiZWwxMDQzMzk3NDU0","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.8","name":"affects_2.8","color":"ededed","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":513652538,"node_id":"MDU6TGFiZWw1MTM2NTI1Mzg=","url":"https://api.github.com/repos/ansible/ansible/labels/core_review","name":"core_review","color":"ededed","default":false},{"id":503572087,"node_id":"MDU6TGFiZWw1MDM1NzIwODc=","url":"https://api.github.com/repos/ansible/ansible/labels/needs_triage","name":"needs_triage","color":"0e8a16","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false},{"id":636352796,"node_id":"MDU6TGFiZWw2MzYzNTI3OTY=","url":"https://api.github.com/repos/ansible/ansible/labels/support:core","name":"support:core","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/50459/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/50459/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/50459/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/e6f0969692508dd6b1e2e28beb3920645a96e37d","head":{"label":"mkrizek:template-ansible_failed_task","ref":"template-ansible_failed_task","sha":"e6f0969692508dd6b1e2e28beb3920645a96e37d","user":{"login":"mkrizek","id":1215518,"node_id":"MDQ6VXNlcjEyMTU1MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1215518?v=4","gravatar_id":"","url":"https://api.github.com/users/mkrizek","html_url":"https://github.com/mkrizek","followers_url":"https://api.github.com/users/mkrizek/followers","following_url":"https://api.github.com/users/mkrizek/following{/other_user}","gists_url":"https://api.github.com/users/mkrizek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkrizek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkrizek/subscriptions","organizations_url":"https://api.github.com/users/mkrizek/orgs","repos_url":"https://api.github.com/users/mkrizek/repos","events_url":"https://api.github.com/users/mkrizek/events{/privacy}","received_events_url":"https://api.github.com/users/mkrizek/received_events","type":"User","site_admin":false},"repo":{"id":97448309,"node_id":"MDEwOlJlcG9zaXRvcnk5NzQ0ODMwOQ==","name":"ansible","full_name":"mkrizek/ansible","private":false,"owner":{"login":"mkrizek","id":1215518,"node_id":"MDQ6VXNlcjEyMTU1MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1215518?v=4","gravatar_id":"","url":"https://api.github.com/users/mkrizek","html_url":"https://github.com/mkrizek","followers_url":"https://api.github.com/users/mkrizek/followers","following_url":"https://api.github.com/users/mkrizek/following{/other_user}","gists_url":"https://api.github.com/users/mkrizek/gists{/gist_id}","starred_url":"https://api.github.com/users/mkrizek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkrizek/subscriptions","organizations_url":"https://api.github.com/users/mkrizek/orgs","repos_url":"https://api.github.com/users/mkrizek/repos","events_url":"https://api.github.com/users/mkrizek/events{/privacy}","received_events_url":"https://api.github.com/users/mkrizek/received_events","type":"User","site_admin":false},"html_url":"https://github.com/mkrizek/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.","fork":true,"url":"https://api.github.com/repos/mkrizek/ansible","forks_url":"https://api.github.com/repos/mkrizek/ansible/forks","keys_url":"https://api.github.com/repos/mkrizek/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkrizek/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkrizek/ansible/teams","hooks_url":"https://api.github.com/repos/mkrizek/ansible/hooks","issue_events_url":"https://api.github.com/repos/mkrizek/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/mkrizek/ansible/events","assignees_url":"https://api.github.com/repos/mkrizek/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/mkrizek/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/mkrizek/ansible/tags","blobs_url":"https://api.github.com/repos/mkrizek/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkrizek/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkrizek/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkrizek/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkrizek/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/mkrizek/ansible/languages","stargazers_url":"https://api.github.com/repos/mkrizek/ansible/stargazers","contributors_url":"https://api.github.com/repos/mkrizek/ansible/contributors","subscribers_url":"https://api.github.com/repos/mkrizek/ansible/subscribers","subscription_url":"https://api.github.com/repos/mkrizek/ansible/subscription","commits_url":"https://api.github.com/repos/mkrizek/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkrizek/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkrizek/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkrizek/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/mkrizek/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/mkrizek/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkrizek/ansible/merges","archive_url":"https://api.github.com/repos/mkrizek/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkrizek/ansible/downloads","issues_url":"https://api.github.com/repos/mkrizek/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/mkrizek/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/mkrizek/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/mkrizek/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkrizek/ansible/labels{/name}","releases_url":"https://api.github.com/repos/mkrizek/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/mkrizek/ansible/deployments","created_at":"2017-07-17T07:36:40Z","updated_at":"2017-07-17T07:37:04Z","pushed_at":"2019-01-02T17:26:17Z","git_url":"git://github.com/mkrizek/ansible.git","ssh_url":"git@github.com:mkrizek/ansible.git","clone_url":"https://github.com/mkrizek/ansible.git","svn_url":"https://github.com/mkrizek/ansible","homepage":"http://ansible.com/","size":131931,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"69deb738036fc8968be81794800c27c4c7b6565d","user":{"login":"ansible","id":1507452,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDc0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"node_id":"MDEwOlJlcG9zaXRvcnkzNjM4OTY0","name":"ansible","full_name":"ansible/ansible","private":false,"owner":{"login":"ansible","id":1507452,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDc0NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications — automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com/ansible/","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2019-01-02T17:18:12Z","pushed_at":"2019-01-02T17:49:29Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"https://www.ansible.com/","size":148948,"stargazers_count":34595,"watchers_count":34595,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13892,"mirror_url":null,"archived":false,"open_issues_count":5623,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":13892,"open_issues":5623,"watchers":34595,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/50459"},"html":{"href":"https://github.com/ansible/ansible/pull/50459"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/50459"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/50459/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/50459/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/50459/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/e6f0969692508dd6b1e2e28beb3920645a96e37d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"bcoca"}}