{"action":"opened","number":5538,"pull_request":{"url":"https://api.github.com/repos/hashicorp/packer/pulls/5538","id":150293712,"html_url":"https://github.com/hashicorp/packer/pull/5538","diff_url":"https://github.com/hashicorp/packer/pull/5538.diff","patch_url":"https://github.com/hashicorp/packer/pull/5538.patch","issue_url":"https://api.github.com/repos/hashicorp/packer/issues/5538","number":5538,"state":"open","locked":false,"title":"builder/triton: Add a data source for source_machine_image","user":{"login":"stack72","id":227823,"avatar_url":"https://avatars1.githubusercontent.com/u/227823?v=4","gravatar_id":"","url":"https://api.github.com/users/stack72","html_url":"https://github.com/stack72","followers_url":"https://api.github.com/users/stack72/followers","following_url":"https://api.github.com/users/stack72/following{/other_user}","gists_url":"https://api.github.com/users/stack72/gists{/gist_id}","starred_url":"https://api.github.com/users/stack72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stack72/subscriptions","organizations_url":"https://api.github.com/users/stack72/orgs","repos_url":"https://api.github.com/users/stack72/repos","events_url":"https://api.github.com/users/stack72/events{/privacy}","received_events_url":"https://api.github.com/users/stack72/received_events","type":"User","site_admin":false},"body":"fixes: #5476\r\n\r\nBased on this new template addition:\r\n\r\n```\r\n{\r\n    \"variables\": {\r\n        \"image_version\": \"\",\r\n        \"triton_account\": \"\",\r\n        \"triton_key_id\": \"\",\r\n        \"triton_key_material\": \"\"\r\n    },\r\n    \"builders\": [{\r\n        \"type\": \"triton\",\r\n        \"triton_account\": \"{{user `triton_account`}}\",\r\n        \"triton_key_id\": \"{{user `triton_key_id`}}\",\r\n        \"triton_key_material\": \"{{user `triton_key_material`}}\",\r\n        \"source_machine_package\": \"g4-highcpu-128M\",\r\n        \"source_machine_image_filter\": {\r\n          \"name\": \"ubuntu-16.04\",\r\n          \"most_recent\": \"true\"\r\n        },\r\n        \"ssh_username\": \"root\",\r\n        \"image_version\": \"{{user `image_version`}}\",\r\n        \"image_name\": \"teamcity-server\"\r\n    }],\r\n    \"provisioners\": [\r\n        {\r\n            \"type\": \"shell\",\r\n            \"start_retry_timeout\": \"10m\",\r\n            \"inline\": [\r\n                \"sudo apt-get update -y\",\r\n                \"sudo apt-get install -y nginx\"\r\n            ]\r\n        }\r\n    ]\r\n}\r\n\r\n```\r\n\r\nI got the following output from packer:\r\n\r\n```\r\npacker-testing % make image\r\npacker build \\\r\n\t\t-var \"triton_account=stack72_joyent\" \\\r\n\t\t-var \"triton_key_id=40:9d:d3:f9:0b:86:62:48:f4:2e:a5:8e:43:00:2a:9b\" \\\r\n\t\t-var \"triton_key_material=\"\"\" \\\r\n\t\t-var \"image_version=1.0.0\" \\\r\n\t\tnew-template.json\r\ntriton output will be in this color.\r\n\r\n==> triton: Selecting an image based on search criteria\r\n==> triton: Based, on given search criteria, Machine ID is: \"7b5981c4-1889-11e7-b4c5-3f3bdfc9b88b\"\r\n==> triton: Waiting for source machine to become available...\r\n==> triton: Waiting for SSH to become available...\r\n==> triton: Connected to SSH!\r\n==> triton: Provisioning with shell script: /var/folders/_p/2_zj9lqn4n11fx20qy787p7c0000gn/T/packer-shell797317310\r\n    triton: Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]\r\n    triton: Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease\r\n```\r\n\r\nI can verify from the triton cli tools that the id `7b5981c4` (from the packer output) is indeed the correct ID\r\n\r\n```\r\nterraform [master●] % triton images name=~ubuntu-16.04\r\nSHORTID   NAME          VERSION   FLAGS  OS     TYPE        PUBDATE\r\n49b22aec  ubuntu-16.04  20160427  P      linux  lx-dataset  2016-04-27\r\n675834a0  ubuntu-16.04  20160505  P      linux  lx-dataset  2016-05-05\r\n4edaa46a  ubuntu-16.04  20160516  P      linux  lx-dataset  2016-05-16\r\n05140a7e  ubuntu-16.04  20160601  P      linux  lx-dataset  2016-06-01\r\ne331b22a  ubuntu-16.04  20161004  P      linux  lx-dataset  2016-10-04\r\n8879c758  ubuntu-16.04  20161213  P      linux  lx-dataset  2016-12-13\r\n7b5981c4  ubuntu-16.04  20170403  P      linux  lx-dataset  2017-04-03 <------- THIS IS THE LATEST UBUNTU IMAGE\r\n```\r\n\r\n**DELETE THIS TEMPLATE BEFORE SUBMITTING**\r\n\r\nDescribe the change you are making here!\r\n\r\nPlease include tests. Check out these examples:\r\n\r\n- https://github.com/hashicorp/packer/blob/master/builder/virtualbox/common/ssh_config_test.go#L19-L37\r\n- https://github.com/hashicorp/packer/blob/master/post-processor/compress/post-processor_test.go#L153-L182\r\n\r\nIf your PR resolves any open issue(s), please indicate them like this so they will be closed when your PR is merged:\r\n\r\nCloses #xxx\r\nCloses #xxx\r\n","created_at":"2017-11-02T13:42:03Z","updated_at":"2017-11-02T13:42:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[{"login":"jen20","id":548524,"avatar_url":"https://avatars2.githubusercontent.com/u/548524?v=4","gravatar_id":"","url":"https://api.github.com/users/jen20","html_url":"https://github.com/jen20","followers_url":"https://api.github.com/users/jen20/followers","following_url":"https://api.github.com/users/jen20/following{/other_user}","gists_url":"https://api.github.com/users/jen20/gists{/gist_id}","starred_url":"https://api.github.com/users/jen20/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jen20/subscriptions","organizations_url":"https://api.github.com/users/jen20/orgs","repos_url":"https://api.github.com/users/jen20/repos","events_url":"https://api.github.com/users/jen20/events{/privacy}","received_events_url":"https://api.github.com/users/jen20/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hashicorp/packer/pulls/5538/commits","review_comments_url":"https://api.github.com/repos/hashicorp/packer/pulls/5538/comments","review_comment_url":"https://api.github.com/repos/hashicorp/packer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hashicorp/packer/issues/5538/comments","statuses_url":"https://api.github.com/repos/hashicorp/packer/statuses/36ed8edf4e3966616ae14aee8ba8d4e091c36549","head":{"label":"stack72:triton-image-data-source","ref":"triton-image-data-source","sha":"36ed8edf4e3966616ae14aee8ba8d4e091c36549","user":{"login":"stack72","id":227823,"avatar_url":"https://avatars1.githubusercontent.com/u/227823?v=4","gravatar_id":"","url":"https://api.github.com/users/stack72","html_url":"https://github.com/stack72","followers_url":"https://api.github.com/users/stack72/followers","following_url":"https://api.github.com/users/stack72/following{/other_user}","gists_url":"https://api.github.com/users/stack72/gists{/gist_id}","starred_url":"https://api.github.com/users/stack72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stack72/subscriptions","organizations_url":"https://api.github.com/users/stack72/orgs","repos_url":"https://api.github.com/users/stack72/repos","events_url":"https://api.github.com/users/stack72/events{/privacy}","received_events_url":"https://api.github.com/users/stack72/received_events","type":"User","site_admin":false},"repo":{"id":109012278,"name":"packer","full_name":"stack72/packer","owner":{"login":"stack72","id":227823,"avatar_url":"https://avatars1.githubusercontent.com/u/227823?v=4","gravatar_id":"","url":"https://api.github.com/users/stack72","html_url":"https://github.com/stack72","followers_url":"https://api.github.com/users/stack72/followers","following_url":"https://api.github.com/users/stack72/following{/other_user}","gists_url":"https://api.github.com/users/stack72/gists{/gist_id}","starred_url":"https://api.github.com/users/stack72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stack72/subscriptions","organizations_url":"https://api.github.com/users/stack72/orgs","repos_url":"https://api.github.com/users/stack72/repos","events_url":"https://api.github.com/users/stack72/events{/privacy}","received_events_url":"https://api.github.com/users/stack72/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stack72/packer","description":"Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.","fork":true,"url":"https://api.github.com/repos/stack72/packer","forks_url":"https://api.github.com/repos/stack72/packer/forks","keys_url":"https://api.github.com/repos/stack72/packer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stack72/packer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stack72/packer/teams","hooks_url":"https://api.github.com/repos/stack72/packer/hooks","issue_events_url":"https://api.github.com/repos/stack72/packer/issues/events{/number}","events_url":"https://api.github.com/repos/stack72/packer/events","assignees_url":"https://api.github.com/repos/stack72/packer/assignees{/user}","branches_url":"https://api.github.com/repos/stack72/packer/branches{/branch}","tags_url":"https://api.github.com/repos/stack72/packer/tags","blobs_url":"https://api.github.com/repos/stack72/packer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stack72/packer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stack72/packer/git/refs{/sha}","trees_url":"https://api.github.com/repos/stack72/packer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stack72/packer/statuses/{sha}","languages_url":"https://api.github.com/repos/stack72/packer/languages","stargazers_url":"https://api.github.com/repos/stack72/packer/stargazers","contributors_url":"https://api.github.com/repos/stack72/packer/contributors","subscribers_url":"https://api.github.com/repos/stack72/packer/subscribers","subscription_url":"https://api.github.com/repos/stack72/packer/subscription","commits_url":"https://api.github.com/repos/stack72/packer/commits{/sha}","git_commits_url":"https://api.github.com/repos/stack72/packer/git/commits{/sha}","comments_url":"https://api.github.com/repos/stack72/packer/comments{/number}","issue_comment_url":"https://api.github.com/repos/stack72/packer/issues/comments{/number}","contents_url":"https://api.github.com/repos/stack72/packer/contents/{+path}","compare_url":"https://api.github.com/repos/stack72/packer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stack72/packer/merges","archive_url":"https://api.github.com/repos/stack72/packer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stack72/packer/downloads","issues_url":"https://api.github.com/repos/stack72/packer/issues{/number}","pulls_url":"https://api.github.com/repos/stack72/packer/pulls{/number}","milestones_url":"https://api.github.com/repos/stack72/packer/milestones{/number}","notifications_url":"https://api.github.com/repos/stack72/packer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stack72/packer/labels{/name}","releases_url":"https://api.github.com/repos/stack72/packer/releases{/id}","deployments_url":"https://api.github.com/repos/stack72/packer/deployments","created_at":"2017-10-31T15:04:32Z","updated_at":"2017-10-31T15:04:37Z","pushed_at":"2017-11-02T13:41:50Z","git_url":"git://github.com/stack72/packer.git","ssh_url":"git@github.com:stack72/packer.git","clone_url":"https://github.com/stack72/packer.git","svn_url":"https://github.com/stack72/packer","homepage":"http://www.packer.io","size":29703,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hashicorp:master","ref":"master","sha":"52558e4f759b0825cfa35d84ec9088040fc0a89d","user":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"repo":{"id":8966356,"name":"packer","full_name":"hashicorp/packer","owner":{"login":"hashicorp","id":761456,"avatar_url":"https://avatars2.githubusercontent.com/u/761456?v=4","gravatar_id":"","url":"https://api.github.com/users/hashicorp","html_url":"https://github.com/hashicorp","followers_url":"https://api.github.com/users/hashicorp/followers","following_url":"https://api.github.com/users/hashicorp/following{/other_user}","gists_url":"https://api.github.com/users/hashicorp/gists{/gist_id}","starred_url":"https://api.github.com/users/hashicorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hashicorp/subscriptions","organizations_url":"https://api.github.com/users/hashicorp/orgs","repos_url":"https://api.github.com/users/hashicorp/repos","events_url":"https://api.github.com/users/hashicorp/events{/privacy}","received_events_url":"https://api.github.com/users/hashicorp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hashicorp/packer","description":"Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.","fork":false,"url":"https://api.github.com/repos/hashicorp/packer","forks_url":"https://api.github.com/repos/hashicorp/packer/forks","keys_url":"https://api.github.com/repos/hashicorp/packer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hashicorp/packer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hashicorp/packer/teams","hooks_url":"https://api.github.com/repos/hashicorp/packer/hooks","issue_events_url":"https://api.github.com/repos/hashicorp/packer/issues/events{/number}","events_url":"https://api.github.com/repos/hashicorp/packer/events","assignees_url":"https://api.github.com/repos/hashicorp/packer/assignees{/user}","branches_url":"https://api.github.com/repos/hashicorp/packer/branches{/branch}","tags_url":"https://api.github.com/repos/hashicorp/packer/tags","blobs_url":"https://api.github.com/repos/hashicorp/packer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hashicorp/packer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hashicorp/packer/git/refs{/sha}","trees_url":"https://api.github.com/repos/hashicorp/packer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hashicorp/packer/statuses/{sha}","languages_url":"https://api.github.com/repos/hashicorp/packer/languages","stargazers_url":"https://api.github.com/repos/hashicorp/packer/stargazers","contributors_url":"https://api.github.com/repos/hashicorp/packer/contributors","subscribers_url":"https://api.github.com/repos/hashicorp/packer/subscribers","subscription_url":"https://api.github.com/repos/hashicorp/packer/subscription","commits_url":"https://api.github.com/repos/hashicorp/packer/commits{/sha}","git_commits_url":"https://api.github.com/repos/hashicorp/packer/git/commits{/sha}","comments_url":"https://api.github.com/repos/hashicorp/packer/comments{/number}","issue_comment_url":"https://api.github.com/repos/hashicorp/packer/issues/comments{/number}","contents_url":"https://api.github.com/repos/hashicorp/packer/contents/{+path}","compare_url":"https://api.github.com/repos/hashicorp/packer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hashicorp/packer/merges","archive_url":"https://api.github.com/repos/hashicorp/packer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hashicorp/packer/downloads","issues_url":"https://api.github.com/repos/hashicorp/packer/issues{/number}","pulls_url":"https://api.github.com/repos/hashicorp/packer/pulls{/number}","milestones_url":"https://api.github.com/repos/hashicorp/packer/milestones{/number}","notifications_url":"https://api.github.com/repos/hashicorp/packer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hashicorp/packer/labels{/name}","releases_url":"https://api.github.com/repos/hashicorp/packer/releases{/id}","deployments_url":"https://api.github.com/repos/hashicorp/packer/deployments","created_at":"2013-03-23T05:43:03Z","updated_at":"2017-11-01T20:47:58Z","pushed_at":"2017-11-02T07:26:14Z","git_url":"git://github.com/hashicorp/packer.git","ssh_url":"git@github.com:hashicorp/packer.git","clone_url":"https://github.com/hashicorp/packer.git","svn_url":"https://github.com/hashicorp/packer","homepage":"http://www.packer.io","size":29777,"stargazers_count":6990,"watchers_count":6990,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1837,"mirror_url":null,"archived":false,"open_issues_count":337,"forks":1837,"open_issues":337,"watchers":6990,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hashicorp/packer/pulls/5538"},"html":{"href":"https://github.com/hashicorp/packer/pull/5538"},"issue":{"href":"https://api.github.com/repos/hashicorp/packer/issues/5538"},"comments":{"href":"https://api.github.com/repos/hashicorp/packer/issues/5538/comments"},"review_comments":{"href":"https://api.github.com/repos/hashicorp/packer/pulls/5538/comments"},"review_comment":{"href":"https://api.github.com/repos/hashicorp/packer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hashicorp/packer/pulls/5538/commits"},"statuses":{"href":"https://api.github.com/repos/hashicorp/packer/statuses/36ed8edf4e3966616ae14aee8ba8d4e091c36549"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":126,"deletions":13,"changed_files":6}}
{"actor":{"display_login":"stack72"}}