{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments/233457410","pull_request_review_id":174871165,"id":233457410,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzQ1NzQxMA==","diff_hunk":"@@ -121,6 +122,29 @@ def run(self, tmp=None, task_vars=None):\n \n         return result\n \n+    def expand_all_jinja2_templates(self, variables):\n+        for k, v in variables.items():\n+            if self._templar.is_template(v):\n+                variables[k] = self.expand_jinja2_template(v)\n+        return variables\n+\n+    def expand_jinja2_template(self, var):\n+        try:\n+            expanded_var = self._templar.template(var, convert_bare=True,\n+                                                  fail_on_undefined=True)\n+            if expanded_var == var:\n+                if not isinstance(expanded_var, string_types):\n+                    raise AnsibleUndefinedVariable\n+                expanded_var = self._templar.template(\"{{\" + expanded_var + \\\n+                                                      \"}}\", convert_bare=True,\n+                                                      fail_on_undefined=True)\n+        except AnsibleUndefinedVariable as e:\n+            expanded_var = u\"VARIABLE IS NOT DEFINED!\"\n+            if self._display.verbosity > 0:\n+                expanded_var += u\": %s\" % str(e)","path":"plugins/actions/validate.py","position":40,"original_position":40,"commit_id":"0cc41267d8897e653d51184975470e60732fed6c","original_commit_id":"0cc41267d8897e653d51184975470e60732fed6c","user":{"login":"alfredodeza","id":317847,"node_id":"MDQ6VXNlcjMxNzg0Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/317847?v=4","gravatar_id":"","url":"https://api.github.com/users/alfredodeza","html_url":"https://github.com/alfredodeza","followers_url":"https://api.github.com/users/alfredodeza/followers","following_url":"https://api.github.com/users/alfredodeza/following{/other_user}","gists_url":"https://api.github.com/users/alfredodeza/gists{/gist_id}","starred_url":"https://api.github.com/users/alfredodeza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfredodeza/subscriptions","organizations_url":"https://api.github.com/users/alfredodeza/orgs","repos_url":"https://api.github.com/users/alfredodeza/repos","events_url":"https://api.github.com/users/alfredodeza/events{/privacy}","received_events_url":"https://api.github.com/users/alfredodeza/received_events","type":"User","site_admin":false},"body":"same here, this isn't a safe string substitution because of the addition. Unless you are absolutely certain this will never blow up because the values are always ensured to be strings","created_at":"2018-11-14T14:00:39Z","updated_at":"2018-11-14T14:03:26Z","html_url":"https://github.com/ceph/ceph-ansible/pull/3326#discussion_r233457410","pull_request_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments/233457410"},"html":{"href":"https://github.com/ceph/ceph-ansible/pull/3326#discussion_r233457410"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326","id":230792672,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwNzkyNjcy","html_url":"https://github.com/ceph/ceph-ansible/pull/3326","diff_url":"https://github.com/ceph/ceph-ansible/pull/3326.diff","patch_url":"https://github.com/ceph/ceph-ansible/pull/3326.patch","issue_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/3326","number":3326,"state":"open","locked":false,"title":"validate: expand all jinja2 templates before validating them","user":{"login":"rishabh-d-dave","id":10697359,"node_id":"MDQ6VXNlcjEwNjk3MzU5","avatar_url":"https://avatars1.githubusercontent.com/u/10697359?v=4","gravatar_id":"","url":"https://api.github.com/users/rishabh-d-dave","html_url":"https://github.com/rishabh-d-dave","followers_url":"https://api.github.com/users/rishabh-d-dave/followers","following_url":"https://api.github.com/users/rishabh-d-dave/following{/other_user}","gists_url":"https://api.github.com/users/rishabh-d-dave/gists{/gist_id}","starred_url":"https://api.github.com/users/rishabh-d-dave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rishabh-d-dave/subscriptions","organizations_url":"https://api.github.com/users/rishabh-d-dave/orgs","repos_url":"https://api.github.com/users/rishabh-d-dave/repos","events_url":"https://api.github.com/users/rishabh-d-dave/events{/privacy}","received_events_url":"https://api.github.com/users/rishabh-d-dave/received_events","type":"User","site_admin":false},"body":"Signed-off-by: Rishabh Dave <ridave@redhat.com>","created_at":"2018-11-14T10:58:52Z","updated_at":"2018-11-14T14:03:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b057e052da7ce70ee3dbf63baacc4675a26f675","assignee":null,"assignees":[],"requested_reviewers":[{"login":"andrewschoen","id":20618,"node_id":"MDQ6VXNlcjIwNjE4","avatar_url":"https://avatars2.githubusercontent.com/u/20618?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewschoen","html_url":"https://github.com/andrewschoen","followers_url":"https://api.github.com/users/andrewschoen/followers","following_url":"https://api.github.com/users/andrewschoen/following{/other_user}","gists_url":"https://api.github.com/users/andrewschoen/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewschoen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewschoen/subscriptions","organizations_url":"https://api.github.com/users/andrewschoen/orgs","repos_url":"https://api.github.com/users/andrewschoen/repos","events_url":"https://api.github.com/users/andrewschoen/events{/privacy}","received_events_url":"https://api.github.com/users/andrewschoen/received_events","type":"User","site_admin":false},{"login":"noahdesu","id":242417,"node_id":"MDQ6VXNlcjI0MjQxNw==","avatar_url":"https://avatars1.githubusercontent.com/u/242417?v=4","gravatar_id":"","url":"https://api.github.com/users/noahdesu","html_url":"https://github.com/noahdesu","followers_url":"https://api.github.com/users/noahdesu/followers","following_url":"https://api.github.com/users/noahdesu/following{/other_user}","gists_url":"https://api.github.com/users/noahdesu/gists{/gist_id}","starred_url":"https://api.github.com/users/noahdesu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noahdesu/subscriptions","organizations_url":"https://api.github.com/users/noahdesu/orgs","repos_url":"https://api.github.com/users/noahdesu/repos","events_url":"https://api.github.com/users/noahdesu/events{/privacy}","received_events_url":"https://api.github.com/users/noahdesu/received_events","type":"User","site_admin":false},{"login":"leseb","id":912735,"node_id":"MDQ6VXNlcjkxMjczNQ==","avatar_url":"https://avatars3.githubusercontent.com/u/912735?v=4","gravatar_id":"","url":"https://api.github.com/users/leseb","html_url":"https://github.com/leseb","followers_url":"https://api.github.com/users/leseb/followers","following_url":"https://api.github.com/users/leseb/following{/other_user}","gists_url":"https://api.github.com/users/leseb/gists{/gist_id}","starred_url":"https://api.github.com/users/leseb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leseb/subscriptions","organizations_url":"https://api.github.com/users/leseb/orgs","repos_url":"https://api.github.com/users/leseb/repos","events_url":"https://api.github.com/users/leseb/events{/privacy}","received_events_url":"https://api.github.com/users/leseb/received_events","type":"User","site_admin":false},{"login":"guits","id":3717838,"node_id":"MDQ6VXNlcjM3MTc4Mzg=","avatar_url":"https://avatars1.githubusercontent.com/u/3717838?v=4","gravatar_id":"","url":"https://api.github.com/users/guits","html_url":"https://github.com/guits","followers_url":"https://api.github.com/users/guits/followers","following_url":"https://api.github.com/users/guits/following{/other_user}","gists_url":"https://api.github.com/users/guits/gists{/gist_id}","starred_url":"https://api.github.com/users/guits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guits/subscriptions","organizations_url":"https://api.github.com/users/guits/orgs","repos_url":"https://api.github.com/users/guits/repos","events_url":"https://api.github.com/users/guits/events{/privacy}","received_events_url":"https://api.github.com/users/guits/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/3326/comments","statuses_url":"https://api.github.com/repos/ceph/ceph-ansible/statuses/0cc41267d8897e653d51184975470e60732fed6c","head":{"label":"rishabh-d-dave:expand-all-jinja2-templates","ref":"expand-all-jinja2-templates","sha":"0cc41267d8897e653d51184975470e60732fed6c","user":{"login":"rishabh-d-dave","id":10697359,"node_id":"MDQ6VXNlcjEwNjk3MzU5","avatar_url":"https://avatars1.githubusercontent.com/u/10697359?v=4","gravatar_id":"","url":"https://api.github.com/users/rishabh-d-dave","html_url":"https://github.com/rishabh-d-dave","followers_url":"https://api.github.com/users/rishabh-d-dave/followers","following_url":"https://api.github.com/users/rishabh-d-dave/following{/other_user}","gists_url":"https://api.github.com/users/rishabh-d-dave/gists{/gist_id}","starred_url":"https://api.github.com/users/rishabh-d-dave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rishabh-d-dave/subscriptions","organizations_url":"https://api.github.com/users/rishabh-d-dave/orgs","repos_url":"https://api.github.com/users/rishabh-d-dave/repos","events_url":"https://api.github.com/users/rishabh-d-dave/events{/privacy}","received_events_url":"https://api.github.com/users/rishabh-d-dave/received_events","type":"User","site_admin":false},"repo":{"id":144122057,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQxMjIwNTc=","name":"ceph-ansible","full_name":"rishabh-d-dave/ceph-ansible","private":false,"owner":{"login":"rishabh-d-dave","id":10697359,"node_id":"MDQ6VXNlcjEwNjk3MzU5","avatar_url":"https://avatars1.githubusercontent.com/u/10697359?v=4","gravatar_id":"","url":"https://api.github.com/users/rishabh-d-dave","html_url":"https://github.com/rishabh-d-dave","followers_url":"https://api.github.com/users/rishabh-d-dave/followers","following_url":"https://api.github.com/users/rishabh-d-dave/following{/other_user}","gists_url":"https://api.github.com/users/rishabh-d-dave/gists{/gist_id}","starred_url":"https://api.github.com/users/rishabh-d-dave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rishabh-d-dave/subscriptions","organizations_url":"https://api.github.com/users/rishabh-d-dave/orgs","repos_url":"https://api.github.com/users/rishabh-d-dave/repos","events_url":"https://api.github.com/users/rishabh-d-dave/events{/privacy}","received_events_url":"https://api.github.com/users/rishabh-d-dave/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rishabh-d-dave/ceph-ansible","description":"Ansible playbooks to deploy Ceph, the distributed filesystem.","fork":true,"url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible","forks_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/forks","keys_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/teams","hooks_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/hooks","issue_events_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/events","assignees_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/tags","blobs_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/languages","stargazers_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/stargazers","contributors_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/contributors","subscribers_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/subscribers","subscription_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/subscription","commits_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/merges","archive_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/downloads","issues_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/labels{/name}","releases_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/releases{/id}","deployments_url":"https://api.github.com/repos/rishabh-d-dave/ceph-ansible/deployments","created_at":"2018-08-09T08:17:36Z","updated_at":"2018-08-09T08:17:39Z","pushed_at":"2018-11-14T11:00:28Z","git_url":"git://github.com/rishabh-d-dave/ceph-ansible.git","ssh_url":"git@github.com:rishabh-d-dave/ceph-ansible.git","clone_url":"https://github.com/rishabh-d-dave/ceph-ansible.git","svn_url":"https://github.com/rishabh-d-dave/ceph-ansible","homepage":"","size":5619,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ceph:master","ref":"master","sha":"661213a6a899faae9d4625e9f18f6fa0ab8515e4","user":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":17373313,"node_id":"MDEwOlJlcG9zaXRvcnkxNzM3MzMxMw==","name":"ceph-ansible","full_name":"ceph/ceph-ansible","private":false,"owner":{"login":"ceph","id":1015767,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwMTU3Njc=","avatar_url":"https://avatars3.githubusercontent.com/u/1015767?v=4","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ceph/ceph-ansible","description":"Ansible playbooks to deploy Ceph, the distributed filesystem.","fork":false,"url":"https://api.github.com/repos/ceph/ceph-ansible","forks_url":"https://api.github.com/repos/ceph/ceph-ansible/forks","keys_url":"https://api.github.com/repos/ceph/ceph-ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph-ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph-ansible/teams","hooks_url":"https://api.github.com/repos/ceph/ceph-ansible/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph-ansible/events","assignees_url":"https://api.github.com/repos/ceph/ceph-ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph-ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph-ansible/tags","blobs_url":"https://api.github.com/repos/ceph/ceph-ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph-ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph-ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph-ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph-ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph-ansible/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph-ansible/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph-ansible/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph-ansible/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph-ansible/subscription","commits_url":"https://api.github.com/repos/ceph/ceph-ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph-ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph-ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph-ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph-ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph-ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph-ansible/merges","archive_url":"https://api.github.com/repos/ceph/ceph-ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph-ansible/downloads","issues_url":"https://api.github.com/repos/ceph/ceph-ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph-ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph-ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph-ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph-ansible/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph-ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ceph/ceph-ansible/deployments","created_at":"2014-03-03T17:12:09Z","updated_at":"2018-11-13T18:31:25Z","pushed_at":"2018-11-14T11:00:29Z","git_url":"git://github.com/ceph/ceph-ansible.git","ssh_url":"git@github.com:ceph/ceph-ansible.git","clone_url":"https://github.com/ceph/ceph-ansible.git","svn_url":"https://github.com/ceph/ceph-ansible","homepage":"","size":5756,"stargazers_count":786,"watchers_count":786,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":523,"mirror_url":null,"archived":false,"open_issues_count":182,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":523,"open_issues":182,"watchers":786,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326"},"html":{"href":"https://github.com/ceph/ceph-ansible/pull/3326"},"issue":{"href":"https://api.github.com/repos/ceph/ceph-ansible/issues/3326"},"comments":{"href":"https://api.github.com/repos/ceph/ceph-ansible/issues/3326/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph-ansible/pulls/3326/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph-ansible/statuses/0cc41267d8897e653d51184975470e60732fed6c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alfredodeza"}}