{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/157118236","pull_request_review_id":83709086,"id":157118236,"diff_hunk":"@@ -0,0 +1,124 @@\n+- name: Create storage account name\n+  set_fact:\n+      storage_account: \"{{ resource_group | hash('md5') | truncate(24, True, '') }}\"\n+\n+- name: Create storage account\n+  azure_rm_storageaccount:\n+      resource_group: \"{{ resource_group }}\"\n+      name: \"{{ storage_account }}\"\n+      account_type: Standard_LRS\n+\n+- name: Create virtual network\n+  azure_rm_virtualnetwork:\n+      resource_group: \"{{ resource_group }}\"\n+      name: testvm001\n+      address_prefixes: \"10.10.0.0/16\"\n+\n+- name: Add subnet\n+  azure_rm_subnet:\n+      resource_group: \"{{ resource_group }}\"\n+      name: testvm001\n+      address_prefix: \"10.10.0.0/24\"\n+      virtual_network: testvm001\n+\n+- name: Create public ip\n+  azure_rm_publicipaddress:\n+      resource_group: \"{{ resource_group }}\"\n+      allocation_method: Static\n+      name: testvm001\n+\n+- name: Create security group\n+  azure_rm_securitygroup:\n+      resource_group: \"{{ resource_group }}\"\n+      name: testvm001\n+\n+- name: Create NIC\n+  azure_rm_networkinterface:\n+      resource_group: \"{{ resource_group }}\"\n+      name: testvm001\n+      virtual_network: testvm001\n+      subnet: testvm001\n+      public_ip_name: testvm001\n+      security_group: testvm001\n+\n+- name: Create virtual machine\n+  azure_rm_virtualmachine:\n+      resource_group: \"{{ resource_group }}\"\n+      name: testvm002\n+      vm_size: Standard_A0\n+      storage_account: \"{{ storage_account }}\"\n+      storage_container: testvm001\n+      storage_blob: testvm001.vhd\n+      admin_username: adminuser\n+      admin_password: Password123!\n+      os_type: Linux\n+      network_interfaces: testvm001\n+      image:\n+        offer: UbuntuServer\n+        publisher: Canonical\n+        sku: 16.04-LTS\n+        version: latest\n+\n+- name: Deallocate the virtual machine\n+  azure_rm_virtualmachine:\n+      resource_group: \"{{ resource_group }}\"\n+      name: testvm002\n+      allocated: no \n+      vm_size: Standard_A0\n+  register: output\n+\n+- name: Start the virtual machine\n+  azure_rm_virtualmachine:\n+      resource_group: \"{{ resource_group }}\"\n+      name: testvm002\n+      vm_size: Standard_A0\n+\n+- name: Create an image from VM (check mode)\n+  azure_rm_image:\n+      resource_group: \"{{ resource_group }}\"\n+      source: \"https://{{ storage_account }}.blob.core.windows.net/testvm001/testvm001.vhd\"\n+      name: testimage001\n+      os_type: Linux\n+  check_mode: yes\n+  register: output\n+\n+- assert:\n+      that: output.changed\n+\n+- name: Create an image from VM\n+  azure_rm_image:\n+      resource_group: \"{{ resource_group }}\"\n+      source: \"https://{{ storage_account }}.blob.core.windows.net/testvm001/testvm001.vhd\"\n+      name: testimage001\n+      os_type: Linux\n+  register: output\n+\n+- assert:\n+      that:\n+          - output.changed\n+          - output.state.osDisk.blobUri == \"https://{{ storage_account }}.blob.core.windows.net/testvm001/testvm001.vhd\"\n+\n+- name: Create an image from VM (idempotent)\n+  azure_rm_image:\n+      resource_group: \"{{ resource_group }}\"\n+      source: \"https://{{ storage_account }}.blob.core.windows.net/testvm001/testvm001.vhd\"\n+      name: testimage001\n+      os_type: Linux\n+  register: output\n+\n+- assert:\n+      that: not output.changed\n+\n+- name: Delete image","path":"test/integration/targets/azure_rm_image/tasks/main.yml","position":112,"original_position":112,"commit_id":"26f87511231b57322c32352c7777db9613be1516","original_commit_id":"26f87511231b57322c32352c7777db9613be1516","user":{"login":"jborean93","id":8462645,"avatar_url":"https://avatars3.githubusercontent.com/u/8462645?v=4","gravatar_id":"","url":"https://api.github.com/users/jborean93","html_url":"https://github.com/jborean93","followers_url":"https://api.github.com/users/jborean93/followers","following_url":"https://api.github.com/users/jborean93/following{/other_user}","gists_url":"https://api.github.com/users/jborean93/gists{/gist_id}","starred_url":"https://api.github.com/users/jborean93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jborean93/subscriptions","organizations_url":"https://api.github.com/users/jborean93/orgs","repos_url":"https://api.github.com/users/jborean93/repos","events_url":"https://api.github.com/users/jborean93/events{/privacy}","received_events_url":"https://api.github.com/users/jborean93/received_events","type":"User","site_admin":false},"body":"Are you able to do the same with this one, run delete in check mode and then a normal delete again to ensure it reports no change","created_at":"2017-12-15T03:35:36Z","updated_at":"2017-12-15T03:35:42Z","html_url":"https://github.com/ansible/ansible/pull/32589#discussion_r157118236","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/32589","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/157118236"},"html":{"href":"https://github.com/ansible/ansible/pull/32589#discussion_r157118236"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/32589"}}},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/32589","id":150822090,"html_url":"https://github.com/ansible/ansible/pull/32589","diff_url":"https://github.com/ansible/ansible/pull/32589.diff","patch_url":"https://github.com/ansible/ansible/pull/32589.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/32589","number":32589,"state":"open","locked":false,"title":"Add azure image module support create and delete","user":{"login":"yuwzho","id":14213176,"avatar_url":"https://avatars0.githubusercontent.com/u/14213176?v=4","gravatar_id":"","url":"https://api.github.com/users/yuwzho","html_url":"https://github.com/yuwzho","followers_url":"https://api.github.com/users/yuwzho/followers","following_url":"https://api.github.com/users/yuwzho/following{/other_user}","gists_url":"https://api.github.com/users/yuwzho/gists{/gist_id}","starred_url":"https://api.github.com/users/yuwzho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuwzho/subscriptions","organizations_url":"https://api.github.com/users/yuwzho/orgs","repos_url":"https://api.github.com/users/yuwzho/repos","events_url":"https://api.github.com/users/yuwzho/events{/privacy}","received_events_url":"https://api.github.com/users/yuwzho/received_events","type":"User","site_admin":false},"body":"##### SUMMARY\r\n<!--- Describe the change, including rationale and design decisions -->\r\nAdd Azure Image module support\r\nIt supports\r\n- Create an image from an existing VM.\r\n- Create an image from OS disk and data disk with OS type specific, where the disk can be a disk, blob uri or snapshot.\r\n- Delete an existing image.\r\n\r\n<!---\r\nIf you are fixing an existing issue, please include \"Fixes #nnn\" in your\r\ncommit message and your description; but you should still explain what\r\nthe change does.\r\n-->\r\n Fix #30940\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - New Module Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the module/plugin/module/task -->\r\nazure_rm_image.py\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\n2.5\r\n```\r\n\r\n\r\n##### ADDITIONAL INFORMATION\r\n<!---\r\nInclude additional information to help people understand the change here.\r\nFor bugs that don't have a linked bug report, a step-by-step reproduction\r\nof the problem is helpful.\r\n  -->\r\n\r\n<!--- Paste verbatim command output below, e.g. before and after your change -->\r\n```\r\n\r\n```\r\n","created_at":"2017-11-06T10:55:35Z","updated_at":"2017-12-15T03:35:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87019519d52ba173c1fc4a33781fffc2521f724c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/32589/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/32589/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/32589/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/26f87511231b57322c32352c7777db9613be1516","head":{"label":"VSChina:yuwzho-azure-image","ref":"yuwzho-azure-image","sha":"26f87511231b57322c32352c7777db9613be1516","user":{"login":"VSChina","id":25995662,"avatar_url":"https://avatars3.githubusercontent.com/u/25995662?v=4","gravatar_id":"","url":"https://api.github.com/users/VSChina","html_url":"https://github.com/VSChina","followers_url":"https://api.github.com/users/VSChina/followers","following_url":"https://api.github.com/users/VSChina/following{/other_user}","gists_url":"https://api.github.com/users/VSChina/gists{/gist_id}","starred_url":"https://api.github.com/users/VSChina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSChina/subscriptions","organizations_url":"https://api.github.com/users/VSChina/orgs","repos_url":"https://api.github.com/users/VSChina/repos","events_url":"https://api.github.com/users/VSChina/events{/privacy}","received_events_url":"https://api.github.com/users/VSChina/received_events","type":"Organization","site_admin":false},"repo":{"id":104982939,"name":"ansible","full_name":"VSChina/ansible","owner":{"login":"VSChina","id":25995662,"avatar_url":"https://avatars3.githubusercontent.com/u/25995662?v=4","gravatar_id":"","url":"https://api.github.com/users/VSChina","html_url":"https://github.com/VSChina","followers_url":"https://api.github.com/users/VSChina/followers","following_url":"https://api.github.com/users/VSChina/following{/other_user}","gists_url":"https://api.github.com/users/VSChina/gists{/gist_id}","starred_url":"https://api.github.com/users/VSChina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VSChina/subscriptions","organizations_url":"https://api.github.com/users/VSChina/orgs","repos_url":"https://api.github.com/users/VSChina/repos","events_url":"https://api.github.com/users/VSChina/events{/privacy}","received_events_url":"https://api.github.com/users/VSChina/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/VSChina/ansible","description":"To sync with ansible's devel branch, click","fork":true,"url":"https://api.github.com/repos/VSChina/ansible","forks_url":"https://api.github.com/repos/VSChina/ansible/forks","keys_url":"https://api.github.com/repos/VSChina/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/VSChina/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/VSChina/ansible/teams","hooks_url":"https://api.github.com/repos/VSChina/ansible/hooks","issue_events_url":"https://api.github.com/repos/VSChina/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/VSChina/ansible/events","assignees_url":"https://api.github.com/repos/VSChina/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/VSChina/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/VSChina/ansible/tags","blobs_url":"https://api.github.com/repos/VSChina/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/VSChina/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/VSChina/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/VSChina/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/VSChina/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/VSChina/ansible/languages","stargazers_url":"https://api.github.com/repos/VSChina/ansible/stargazers","contributors_url":"https://api.github.com/repos/VSChina/ansible/contributors","subscribers_url":"https://api.github.com/repos/VSChina/ansible/subscribers","subscription_url":"https://api.github.com/repos/VSChina/ansible/subscription","commits_url":"https://api.github.com/repos/VSChina/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/VSChina/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/VSChina/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/VSChina/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/VSChina/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/VSChina/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/VSChina/ansible/merges","archive_url":"https://api.github.com/repos/VSChina/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/VSChina/ansible/downloads","issues_url":"https://api.github.com/repos/VSChina/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/VSChina/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/VSChina/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/VSChina/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/VSChina/ansible/labels{/name}","releases_url":"https://api.github.com/repos/VSChina/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/VSChina/ansible/deployments","created_at":"2017-09-27T06:52:43Z","updated_at":"2017-11-30T02:51:49Z","pushed_at":"2017-12-15T03:15:24Z","git_url":"git://github.com/VSChina/ansible.git","ssh_url":"git@github.com:VSChina/ansible.git","clone_url":"https://github.com/VSChina/ansible.git","svn_url":"https://github.com/VSChina/ansible","homepage":"https://travis-ci.org/VSChina/ansible","size":93980,"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":0,"mirror_url":null,"archived":false,"open_issues_count":2,"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"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"dc40efc13f2b344235ff668a2c3c6b235219f239","user":{"login":"ansible","id":1507452,"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,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"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},"private":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.","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":"2017-12-15T03:28:51Z","pushed_at":"2017-12-15T03:34:33Z","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":101948,"stargazers_count":27206,"watchers_count":27206,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9769,"mirror_url":null,"archived":false,"open_issues_count":4533,"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"},"forks":9769,"open_issues":4533,"watchers":27206,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/32589"},"html":{"href":"https://github.com/ansible/ansible/pull/32589"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/32589"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/32589/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/32589/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/32589/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/26f87511231b57322c32352c7777db9613be1516"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jborean93"}}