{"action":"created","comment":{"url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/comments/115464105","pull_request_review_id":37002327,"id":115464105,"diff_hunk":"@@ -16,3 +16,57 @@\n   changed_when: false\n   tags:\n     - always\n+\n+- name: Retrieve vpc level instance facts\n+  ec2_remote_facts:\n+    filters:\n+      instance-state-name: running\n+      \"tag:Stack\": \"{{ vpc_name }}\"\n+  register: vpc_instance_facts\n+  tags:\n+    - always\n+\n+- name: Retrieve target level instance facts\n+  ec2_remote_facts:\n+    filters:\n+      instance-state-name: running\n+      \"tag:Stack\": \"{{ target }}\"\n+  register: target_instance_facts\n+  tags:\n+    - always\n+\n+- name: Add jumphost to runtime group for later usage\n+  add_host:\n+    name: \"jump.{{ vpc_name }}.{{ opg_data.domain }}\"\n+    groups: \"vpc, jumphost\"\n+    hostname: \"jump.{{ vpc_name }}.{{ opg_data.domain }}\"\n+    ansible_user: \"{{ ssh_prov_user|default('jenkins-agent') }}\"\n+    ansible_ssh_common_args: \"{{ ssh_conn_opts| default(omit) }}\"\n+  tags:\n+    - always\n+\n+- name: Add vpc level instances to runtime group for later usage\n+  add_host:\n+    name: \"{{ item.tags.Name }}.internal\"\n+    groups: \"{{ item.tags.Stack  + '_' + item.tags.Role }} \"\n+    hostname: \"{{ item.private_ip_address }}\"\n+    ansible_user: \"{{ ssh_prov_user|default('jenkins-agent') }}\"\n+    ansible_ssh_common_args: \"{{ ssh_conn_opts| default(omit) }}\"\n+    create_time: \"{{ item.launch_time | default(omit) }}\"\n+  with_items: \"{{ vpc_instance_facts.instances | default([]) }}\"\n+  no_log: true\n+  tags:\n+    - always\n+\n+- name: Add target level instances to runtime group for later usage","path":"roles/awscommon/tasks/main.yml","position":46,"original_position":46,"commit_id":"9e38c6ea3884f15a80f1644967916bd9e94904f3","original_commit_id":"9e38c6ea3884f15a80f1644967916bd9e94904f3","user":{"login":"tim-mcarthur-moj","id":17139613,"avatar_url":"https://avatars0.githubusercontent.com/u/17139613?v=3","gravatar_id":"","url":"https://api.github.com/users/tim-mcarthur-moj","html_url":"https://github.com/tim-mcarthur-moj","followers_url":"https://api.github.com/users/tim-mcarthur-moj/followers","following_url":"https://api.github.com/users/tim-mcarthur-moj/following{/other_user}","gists_url":"https://api.github.com/users/tim-mcarthur-moj/gists{/gist_id}","starred_url":"https://api.github.com/users/tim-mcarthur-moj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tim-mcarthur-moj/subscriptions","organizations_url":"https://api.github.com/users/tim-mcarthur-moj/orgs","repos_url":"https://api.github.com/users/tim-mcarthur-moj/repos","events_url":"https://api.github.com/users/tim-mcarthur-moj/events{/privacy}","received_events_url":"https://api.github.com/users/tim-mcarthur-moj/received_events","type":"User","site_admin":false},"body":"this breaks on existing environments where the role tag is missing from jump and master","created_at":"2017-05-09T11:18:57Z","updated_at":"2017-05-09T11:19:07Z","html_url":"https://github.com/ministryofjustice/opg-ansible-roles/pull/55#discussion_r115464105","pull_request_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/comments/115464105"},"html":{"href":"https://github.com/ministryofjustice/opg-ansible-roles/pull/55#discussion_r115464105"},"pull_request":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55","id":117684129,"html_url":"https://github.com/ministryofjustice/opg-ansible-roles/pull/55","diff_url":"https://github.com/ministryofjustice/opg-ansible-roles/pull/55.diff","patch_url":"https://github.com/ministryofjustice/opg-ansible-roles/pull/55.patch","issue_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/55","number":55,"state":"open","locked":false,"title":"Opgops 1910","user":{"login":"brettminnie","id":6124248,"avatar_url":"https://avatars3.githubusercontent.com/u/6124248?v=3","gravatar_id":"","url":"https://api.github.com/users/brettminnie","html_url":"https://github.com/brettminnie","followers_url":"https://api.github.com/users/brettminnie/followers","following_url":"https://api.github.com/users/brettminnie/following{/other_user}","gists_url":"https://api.github.com/users/brettminnie/gists{/gist_id}","starred_url":"https://api.github.com/users/brettminnie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brettminnie/subscriptions","organizations_url":"https://api.github.com/users/brettminnie/orgs","repos_url":"https://api.github.com/users/brettminnie/repos","events_url":"https://api.github.com/users/brettminnie/events{/privacy}","received_events_url":"https://api.github.com/users/brettminnie/received_events","type":"User","site_admin":false},"body":" * Refactored RDS creation into own task\r\n * RDS SG creation happens earlier in stack creation to avoid timing issues\r\n * Can create ad-hoc users from meta-data now","created_at":"2017-04-26T10:46:01Z","updated_at":"2017-05-09T11:19:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"10cedd853429d4a7e2f7f4051d0e76e0fd8f431a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55/commits","review_comments_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55/comments","review_comment_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/55/comments","statuses_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/statuses/9e38c6ea3884f15a80f1644967916bd9e94904f3","head":{"label":"ministryofjustice:OPGOPS-1910","ref":"OPGOPS-1910","sha":"9e38c6ea3884f15a80f1644967916bd9e94904f3","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars0.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":62559370,"name":"opg-ansible-roles","full_name":"ministryofjustice/opg-ansible-roles","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars0.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/opg-ansible-roles","description":"A collection of ansible roles to be used in provisioning an environment in AWS","fork":false,"url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles","forks_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/forks","keys_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/events","assignees_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/merges","archive_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/deployments","created_at":"2016-07-04T12:09:02Z","updated_at":"2016-07-04T12:26:03Z","pushed_at":"2017-05-09T11:09:07Z","git_url":"git://github.com/ministryofjustice/opg-ansible-roles.git","ssh_url":"git@github.com:ministryofjustice/opg-ansible-roles.git","clone_url":"https://github.com/ministryofjustice/opg-ansible-roles.git","svn_url":"https://github.com/ministryofjustice/opg-ansible-roles","homepage":null,"size":343,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"ministryofjustice:master","ref":"master","sha":"386e9b6bea63eb712ba18cda083dbb404c3a80a3","user":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars0.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"repo":{"id":62559370,"name":"opg-ansible-roles","full_name":"ministryofjustice/opg-ansible-roles","owner":{"login":"ministryofjustice","id":2203574,"avatar_url":"https://avatars0.githubusercontent.com/u/2203574?v=3","gravatar_id":"","url":"https://api.github.com/users/ministryofjustice","html_url":"https://github.com/ministryofjustice","followers_url":"https://api.github.com/users/ministryofjustice/followers","following_url":"https://api.github.com/users/ministryofjustice/following{/other_user}","gists_url":"https://api.github.com/users/ministryofjustice/gists{/gist_id}","starred_url":"https://api.github.com/users/ministryofjustice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ministryofjustice/subscriptions","organizations_url":"https://api.github.com/users/ministryofjustice/orgs","repos_url":"https://api.github.com/users/ministryofjustice/repos","events_url":"https://api.github.com/users/ministryofjustice/events{/privacy}","received_events_url":"https://api.github.com/users/ministryofjustice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ministryofjustice/opg-ansible-roles","description":"A collection of ansible roles to be used in provisioning an environment in AWS","fork":false,"url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles","forks_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/forks","keys_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/teams","hooks_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/hooks","issue_events_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/events{/number}","events_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/events","assignees_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/assignees{/user}","branches_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/branches{/branch}","tags_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/tags","blobs_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/refs{/sha}","trees_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/statuses/{sha}","languages_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/languages","stargazers_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/stargazers","contributors_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/contributors","subscribers_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/subscribers","subscription_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/subscription","commits_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/commits{/sha}","git_commits_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/git/commits{/sha}","comments_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/comments{/number}","issue_comment_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/comments{/number}","contents_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/contents/{+path}","compare_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/merges","archive_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/downloads","issues_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues{/number}","pulls_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls{/number}","milestones_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/milestones{/number}","notifications_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/labels{/name}","releases_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/releases{/id}","deployments_url":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/deployments","created_at":"2016-07-04T12:09:02Z","updated_at":"2016-07-04T12:26:03Z","pushed_at":"2017-05-09T11:09:07Z","git_url":"git://github.com/ministryofjustice/opg-ansible-roles.git","ssh_url":"git@github.com:ministryofjustice/opg-ansible-roles.git","clone_url":"https://github.com/ministryofjustice/opg-ansible-roles.git","svn_url":"https://github.com/ministryofjustice/opg-ansible-roles","homepage":null,"size":343,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55"},"html":{"href":"https://github.com/ministryofjustice/opg-ansible-roles/pull/55"},"issue":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/55"},"comments":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/ministryofjustice/opg-ansible-roles/statuses/9e38c6ea3884f15a80f1644967916bd9e94904f3"}}}}
{"actor":{"display_login":"tim-mcarthur-moj"}}