{"action":"created","comment":{"url":"https://api.github.com/repos/volanja/ansible_spec/pulls/comments/212653337","pull_request_review_id":149334652,"id":212653337,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjY1MzMzNw==","diff_hunk":"@@ -8,9 +8,15 @@\n \n module AnsibleSpec\n   # param: inventory file of Ansible\n+  # param: return_type 'groups' or 'groups_parent_child_relationships'\n   # return: Hash {\"group\" => [\"192.168.0.1\",\"192.168.0.2\"]}\n   # return: Hash {\"group\" => [{\"name\" => \"192.168.0.1\",\"uri\" => \"192.168.0.1\", \"port\" => 22},...]}\n-  def self.load_targets(file)\n+  # return: Hash {\"pg\" => [\"server\", \"databases\"]}\n+  def self.load_targets(file, return_type = 'groups')\n+    if not ['groups', 'groups_parent_child_relationships'].include?(return_type)\n+      raise ArgumentError, \"Variable return_type must be value 'groups' or 'groups_parent_child_relationships'\"","path":"lib/ansible_spec/load_ansible.rb","position":11,"original_position":11,"commit_id":"a0a37954de5efbf264f92a37272c1962ef38b500","original_commit_id":"ac80a23f85ed96e3ed65e06baaaeaabc88f7a4a8","user":{"login":"rbramwell","id":4683529,"node_id":"MDQ6VXNlcjQ2ODM1Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/4683529?v=4","gravatar_id":"","url":"https://api.github.com/users/rbramwell","html_url":"https://github.com/rbramwell","followers_url":"https://api.github.com/users/rbramwell/followers","following_url":"https://api.github.com/users/rbramwell/following{/other_user}","gists_url":"https://api.github.com/users/rbramwell/gists{/gist_id}","starred_url":"https://api.github.com/users/rbramwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbramwell/subscriptions","organizations_url":"https://api.github.com/users/rbramwell/orgs","repos_url":"https://api.github.com/users/rbramwell/repos","events_url":"https://api.github.com/users/rbramwell/events{/privacy}","received_events_url":"https://api.github.com/users/rbramwell/received_events","type":"User","site_admin":false},"body":"Test added and tests passed.","created_at":"2018-08-24T14:47:15Z","updated_at":"2018-08-24T14:47:15Z","html_url":"https://github.com/volanja/ansible_spec/pull/118#discussion_r212653337","pull_request_url":"https://api.github.com/repos/volanja/ansible_spec/pulls/118","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/volanja/ansible_spec/pulls/comments/212653337"},"html":{"href":"https://github.com/volanja/ansible_spec/pull/118#discussion_r212653337"},"pull_request":{"href":"https://api.github.com/repos/volanja/ansible_spec/pulls/118"}},"in_reply_to_id":212016174},"pull_request":{"url":"https://api.github.com/repos/volanja/ansible_spec/pulls/118","id":210082933,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwMDgyOTMz","html_url":"https://github.com/volanja/ansible_spec/pull/118","diff_url":"https://github.com/volanja/ansible_spec/pull/118.diff","patch_url":"https://github.com/volanja/ansible_spec/pull/118.patch","issue_url":"https://api.github.com/repos/volanja/ansible_spec/issues/118","number":118,"state":"open","locked":false,"title":"Incorporate group parent child relationships into variable assignment hierarchy","user":{"login":"rbramwell","id":4683529,"node_id":"MDQ6VXNlcjQ2ODM1Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/4683529?v=4","gravatar_id":"","url":"https://api.github.com/users/rbramwell","html_url":"https://github.com/rbramwell","followers_url":"https://api.github.com/users/rbramwell/followers","following_url":"https://api.github.com/users/rbramwell/following{/other_user}","gists_url":"https://api.github.com/users/rbramwell/gists{/gist_id}","starred_url":"https://api.github.com/users/rbramwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbramwell/subscriptions","organizations_url":"https://api.github.com/users/rbramwell/orgs","repos_url":"https://api.github.com/users/rbramwell/repos","events_url":"https://api.github.com/users/rbramwell/events{/privacy}","received_events_url":"https://api.github.com/users/rbramwell/received_events","type":"User","site_admin":false},"body":"**TL;DR:**\r\n\r\nMakes variables that are set at the parent group level available to child groups.\r\n\r\n**Overview:**\r\n\r\nThe current code base does away with [parentgroup:children] groups in favour of converting the parent group into a group at the same level as its children. However, this dismisses the fact that parent-child relationships add a level of precedence to variable assignments for groups. This PR adds this logic to better align ansible_spec variable assignments with how this is done in Ansible.\r\n\r\n**Example:**\r\n\r\nhosts file:\r\n\r\n![screenshot at 2018-08-22 05-25-50](https://user-images.githubusercontent.com/4683529/44458598-5a32f300-a5cc-11e8-8e74-c2fff1e8d2bb.png)\r\n\r\nMakes variables set in ./group_vars/parentgroup/vars (or any files in the dir) available to hosts in the [group1] and [group2] groups.","created_at":"2018-08-22T10:09:28Z","updated_at":"2018-08-24T14:47:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7b2fbf9ff67d4ba0decef9f208ec0be2108c9758","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/volanja/ansible_spec/milestones/12","html_url":"https://github.com/volanja/ansible_spec/milestone/12","labels_url":"https://api.github.com/repos/volanja/ansible_spec/milestones/12/labels","id":3596562,"node_id":"MDk6TWlsZXN0b25lMzU5NjU2Mg==","number":12,"title":"0.2.25","description":"","creator":{"login":"volanja","id":5407428,"node_id":"MDQ6VXNlcjU0MDc0Mjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5407428?v=4","gravatar_id":"","url":"https://api.github.com/users/volanja","html_url":"https://github.com/volanja","followers_url":"https://api.github.com/users/volanja/followers","following_url":"https://api.github.com/users/volanja/following{/other_user}","gists_url":"https://api.github.com/users/volanja/gists{/gist_id}","starred_url":"https://api.github.com/users/volanja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volanja/subscriptions","organizations_url":"https://api.github.com/users/volanja/orgs","repos_url":"https://api.github.com/users/volanja/repos","events_url":"https://api.github.com/users/volanja/events{/privacy}","received_events_url":"https://api.github.com/users/volanja/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2018-08-24T13:03:01Z","updated_at":"2018-08-24T13:05:30Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/volanja/ansible_spec/pulls/118/commits","review_comments_url":"https://api.github.com/repos/volanja/ansible_spec/pulls/118/comments","review_comment_url":"https://api.github.com/repos/volanja/ansible_spec/pulls/comments{/number}","comments_url":"https://api.github.com/repos/volanja/ansible_spec/issues/118/comments","statuses_url":"https://api.github.com/repos/volanja/ansible_spec/statuses/a0a37954de5efbf264f92a37272c1962ef38b500","head":{"label":"rbramwell:fix-parent-rels-in-var-assignment","ref":"fix-parent-rels-in-var-assignment","sha":"a0a37954de5efbf264f92a37272c1962ef38b500","user":{"login":"rbramwell","id":4683529,"node_id":"MDQ6VXNlcjQ2ODM1Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/4683529?v=4","gravatar_id":"","url":"https://api.github.com/users/rbramwell","html_url":"https://github.com/rbramwell","followers_url":"https://api.github.com/users/rbramwell/followers","following_url":"https://api.github.com/users/rbramwell/following{/other_user}","gists_url":"https://api.github.com/users/rbramwell/gists{/gist_id}","starred_url":"https://api.github.com/users/rbramwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbramwell/subscriptions","organizations_url":"https://api.github.com/users/rbramwell/orgs","repos_url":"https://api.github.com/users/rbramwell/repos","events_url":"https://api.github.com/users/rbramwell/events{/privacy}","received_events_url":"https://api.github.com/users/rbramwell/received_events","type":"User","site_admin":false},"repo":{"id":145649084,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU2NDkwODQ=","name":"ansible_spec","full_name":"rbramwell/ansible_spec","owner":{"login":"rbramwell","id":4683529,"node_id":"MDQ6VXNlcjQ2ODM1Mjk=","avatar_url":"https://avatars0.githubusercontent.com/u/4683529?v=4","gravatar_id":"","url":"https://api.github.com/users/rbramwell","html_url":"https://github.com/rbramwell","followers_url":"https://api.github.com/users/rbramwell/followers","following_url":"https://api.github.com/users/rbramwell/following{/other_user}","gists_url":"https://api.github.com/users/rbramwell/gists{/gist_id}","starred_url":"https://api.github.com/users/rbramwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbramwell/subscriptions","organizations_url":"https://api.github.com/users/rbramwell/orgs","repos_url":"https://api.github.com/users/rbramwell/repos","events_url":"https://api.github.com/users/rbramwell/events{/privacy}","received_events_url":"https://api.github.com/users/rbramwell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rbramwell/ansible_spec","description":"It's ruby gem that connect Ansible & Serverspec for Test Driven Server Configuration(or TDD).","fork":true,"url":"https://api.github.com/repos/rbramwell/ansible_spec","forks_url":"https://api.github.com/repos/rbramwell/ansible_spec/forks","keys_url":"https://api.github.com/repos/rbramwell/ansible_spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rbramwell/ansible_spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rbramwell/ansible_spec/teams","hooks_url":"https://api.github.com/repos/rbramwell/ansible_spec/hooks","issue_events_url":"https://api.github.com/repos/rbramwell/ansible_spec/issues/events{/number}","events_url":"https://api.github.com/repos/rbramwell/ansible_spec/events","assignees_url":"https://api.github.com/repos/rbramwell/ansible_spec/assignees{/user}","branches_url":"https://api.github.com/repos/rbramwell/ansible_spec/branches{/branch}","tags_url":"https://api.github.com/repos/rbramwell/ansible_spec/tags","blobs_url":"https://api.github.com/repos/rbramwell/ansible_spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rbramwell/ansible_spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rbramwell/ansible_spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/rbramwell/ansible_spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rbramwell/ansible_spec/statuses/{sha}","languages_url":"https://api.github.com/repos/rbramwell/ansible_spec/languages","stargazers_url":"https://api.github.com/repos/rbramwell/ansible_spec/stargazers","contributors_url":"https://api.github.com/repos/rbramwell/ansible_spec/contributors","subscribers_url":"https://api.github.com/repos/rbramwell/ansible_spec/subscribers","subscription_url":"https://api.github.com/repos/rbramwell/ansible_spec/subscription","commits_url":"https://api.github.com/repos/rbramwell/ansible_spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/rbramwell/ansible_spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/rbramwell/ansible_spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/rbramwell/ansible_spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/rbramwell/ansible_spec/contents/{+path}","compare_url":"https://api.github.com/repos/rbramwell/ansible_spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rbramwell/ansible_spec/merges","archive_url":"https://api.github.com/repos/rbramwell/ansible_spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rbramwell/ansible_spec/downloads","issues_url":"https://api.github.com/repos/rbramwell/ansible_spec/issues{/number}","pulls_url":"https://api.github.com/repos/rbramwell/ansible_spec/pulls{/number}","milestones_url":"https://api.github.com/repos/rbramwell/ansible_spec/milestones{/number}","notifications_url":"https://api.github.com/repos/rbramwell/ansible_spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rbramwell/ansible_spec/labels{/name}","releases_url":"https://api.github.com/repos/rbramwell/ansible_spec/releases{/id}","deployments_url":"https://api.github.com/repos/rbramwell/ansible_spec/deployments","created_at":"2018-08-22T03:08:24Z","updated_at":"2018-08-22T03:08:26Z","pushed_at":"2018-08-24T14:41:30Z","git_url":"git://github.com/rbramwell/ansible_spec.git","ssh_url":"git@github.com:rbramwell/ansible_spec.git","clone_url":"https://github.com/rbramwell/ansible_spec.git","svn_url":"https://github.com/rbramwell/ansible_spec","homepage":"","size":257,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"volanja:master","ref":"master","sha":"e30c15f56c2230428d8beba71249759c642f4403","user":{"login":"volanja","id":5407428,"node_id":"MDQ6VXNlcjU0MDc0Mjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5407428?v=4","gravatar_id":"","url":"https://api.github.com/users/volanja","html_url":"https://github.com/volanja","followers_url":"https://api.github.com/users/volanja/followers","following_url":"https://api.github.com/users/volanja/following{/other_user}","gists_url":"https://api.github.com/users/volanja/gists{/gist_id}","starred_url":"https://api.github.com/users/volanja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volanja/subscriptions","organizations_url":"https://api.github.com/users/volanja/orgs","repos_url":"https://api.github.com/users/volanja/repos","events_url":"https://api.github.com/users/volanja/events{/privacy}","received_events_url":"https://api.github.com/users/volanja/received_events","type":"User","site_admin":false},"repo":{"id":15652878,"node_id":"MDEwOlJlcG9zaXRvcnkxNTY1Mjg3OA==","name":"ansible_spec","full_name":"volanja/ansible_spec","owner":{"login":"volanja","id":5407428,"node_id":"MDQ6VXNlcjU0MDc0Mjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5407428?v=4","gravatar_id":"","url":"https://api.github.com/users/volanja","html_url":"https://github.com/volanja","followers_url":"https://api.github.com/users/volanja/followers","following_url":"https://api.github.com/users/volanja/following{/other_user}","gists_url":"https://api.github.com/users/volanja/gists{/gist_id}","starred_url":"https://api.github.com/users/volanja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volanja/subscriptions","organizations_url":"https://api.github.com/users/volanja/orgs","repos_url":"https://api.github.com/users/volanja/repos","events_url":"https://api.github.com/users/volanja/events{/privacy}","received_events_url":"https://api.github.com/users/volanja/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/volanja/ansible_spec","description":"It's ruby gem that connect Ansible & Serverspec for Test Driven Server Configuration(or TDD).","fork":false,"url":"https://api.github.com/repos/volanja/ansible_spec","forks_url":"https://api.github.com/repos/volanja/ansible_spec/forks","keys_url":"https://api.github.com/repos/volanja/ansible_spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/volanja/ansible_spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/volanja/ansible_spec/teams","hooks_url":"https://api.github.com/repos/volanja/ansible_spec/hooks","issue_events_url":"https://api.github.com/repos/volanja/ansible_spec/issues/events{/number}","events_url":"https://api.github.com/repos/volanja/ansible_spec/events","assignees_url":"https://api.github.com/repos/volanja/ansible_spec/assignees{/user}","branches_url":"https://api.github.com/repos/volanja/ansible_spec/branches{/branch}","tags_url":"https://api.github.com/repos/volanja/ansible_spec/tags","blobs_url":"https://api.github.com/repos/volanja/ansible_spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/volanja/ansible_spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/volanja/ansible_spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/volanja/ansible_spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/volanja/ansible_spec/statuses/{sha}","languages_url":"https://api.github.com/repos/volanja/ansible_spec/languages","stargazers_url":"https://api.github.com/repos/volanja/ansible_spec/stargazers","contributors_url":"https://api.github.com/repos/volanja/ansible_spec/contributors","subscribers_url":"https://api.github.com/repos/volanja/ansible_spec/subscribers","subscription_url":"https://api.github.com/repos/volanja/ansible_spec/subscription","commits_url":"https://api.github.com/repos/volanja/ansible_spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/volanja/ansible_spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/volanja/ansible_spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/volanja/ansible_spec/issues/comments{/number}","contents_url":"https://api.github.com/repos/volanja/ansible_spec/contents/{+path}","compare_url":"https://api.github.com/repos/volanja/ansible_spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/volanja/ansible_spec/merges","archive_url":"https://api.github.com/repos/volanja/ansible_spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/volanja/ansible_spec/downloads","issues_url":"https://api.github.com/repos/volanja/ansible_spec/issues{/number}","pulls_url":"https://api.github.com/repos/volanja/ansible_spec/pulls{/number}","milestones_url":"https://api.github.com/repos/volanja/ansible_spec/milestones{/number}","notifications_url":"https://api.github.com/repos/volanja/ansible_spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/volanja/ansible_spec/labels{/name}","releases_url":"https://api.github.com/repos/volanja/ansible_spec/releases{/id}","deployments_url":"https://api.github.com/repos/volanja/ansible_spec/deployments","created_at":"2014-01-05T14:54:24Z","updated_at":"2018-08-21T05:10:21Z","pushed_at":"2018-08-24T14:41:32Z","git_url":"git://github.com/volanja/ansible_spec.git","ssh_url":"git@github.com:volanja/ansible_spec.git","clone_url":"https://github.com/volanja/ansible_spec.git","svn_url":"https://github.com/volanja/ansible_spec","homepage":"","size":246,"stargazers_count":201,"watchers_count":201,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":50,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":50,"open_issues":17,"watchers":201,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/volanja/ansible_spec/pulls/118"},"html":{"href":"https://github.com/volanja/ansible_spec/pull/118"},"issue":{"href":"https://api.github.com/repos/volanja/ansible_spec/issues/118"},"comments":{"href":"https://api.github.com/repos/volanja/ansible_spec/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/volanja/ansible_spec/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/volanja/ansible_spec/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/volanja/ansible_spec/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/volanja/ansible_spec/statuses/a0a37954de5efbf264f92a37272c1962ef38b500"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"rbramwell"}}