{"action":"opened","number":3515,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/3515","id":94826000,"html_url":"https://github.com/ansible/ansible-modules-extras/pull/3515","diff_url":"https://github.com/ansible/ansible-modules-extras/pull/3515.diff","patch_url":"https://github.com/ansible/ansible-modules-extras/pull/3515.patch","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3515","number":3515,"state":"open","locked":false,"title":"Fixes #3498 \"The variable '$changed' cannot be retrieved because it has not been set.\"","user":{"login":"twistyWater","id":23435967,"avatar_url":"https://avatars.githubusercontent.com/u/23435967?v=3","gravatar_id":"","url":"https://api.github.com/users/twistyWater","html_url":"https://github.com/twistyWater","followers_url":"https://api.github.com/users/twistyWater/followers","following_url":"https://api.github.com/users/twistyWater/following{/other_user}","gists_url":"https://api.github.com/users/twistyWater/gists{/gist_id}","starred_url":"https://api.github.com/users/twistyWater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twistyWater/subscriptions","organizations_url":"https://api.github.com/users/twistyWater/orgs","repos_url":"https://api.github.com/users/twistyWater/repos","events_url":"https://api.github.com/users/twistyWater/events{/privacy}","received_events_url":"https://api.github.com/users/twistyWater/received_events","type":"User","site_admin":false},"body":"##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bugfix Pull Request\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the plugin/module/task -->\r\nwin_robocopy\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.2.0.0\r\n  config file = /etc/ansible/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\n##### SUMMARY\r\n<!--- Describe the change, including rationale and design decisions -->\r\nSolve \"The variable '$changed' cannot be retrieved because it has not been set.\" error when I use win_robocopy on windows 2012 r2\r\n<!---\r\nIf you are fixing an existing issue, please include \"Fixes #nnnn\" in your commit\r\nmessage and your description; but you should still explain what the change does.\r\n-->\r\n\r\n<!--- Paste verbatim command output below, e.g. before and after your change -->\r\nBefore\r\n```\r\nTASK [server : Backup files] ***********************************\r\ntask path: server/tasks/main.yml:2\r\nUsing module file /usr/lib/python2.7/dist-packages/ansible/modules/extras/windows/win_robocopy.ps1\r\n<192.168.33.20> ESTABLISH WINRM CONNECTION FOR USER: vagrant on PORT 5986 TO 192.168.33.20\r\n<192.168.33.20> EXEC Set-StrictMode -Version Latest\r\n(New-Item -Type Directory -Path $env:temp -Name \"ansible-tmp-1479487487.3-247510806404649\").FullName | Write-Host -Separator '';\r\n<192.168.33.20> PUT \"/tmp/tmpAzBWvQ\" TO \"C:\\Users\\vagrant\\AppData\\Local\\Temp\\ansible-tmp-1479487487.3-247510806404649\\win_robocopy.ps1\"\r\n<192.168.33.20> EXEC Set-StrictMode -Version Latest\r\nTry\r\n{\r\n& 'C:\\Users\\vagrant\\AppData\\Local\\Temp\\ansible-tmp-1479487487.3-247510806404649\\win_robocopy.ps1'\r\n}\r\nCatch\r\n{\r\n$_obj = @{ failed = $true }\r\nIf ($_.Exception.GetType)\r\n{\r\n$_obj.Add('msg', $_.Exception.Message)\r\n}\r\nElse\r\n{\r\n$_obj.Add('msg', $_.ToString())\r\n}\r\nIf ($_.InvocationInfo.PositionMessage)\r\n{\r\n$_obj.Add('exception', $_.InvocationInfo.PositionMessage)\r\n}\r\nElseIf ($_.ScriptStackTrace)\r\n{\r\n$_obj.Add('exception', $_.ScriptStackTrace)\r\n}\r\nTry\r\n{\r\n$_obj.Add('error_record', ($_ | ConvertTo-Json | ConvertFrom-Json))\r\n}\r\nCatch\r\n{\r\n}\r\nEcho $_obj | ConvertTo-Json -Compress -Depth 99\r\nExit 1\r\n}\r\nFinally { Remove-Item \"C:\\Users\\vagrant\\AppData\\Local\\Temp\\ansible-tmp-1479487487.3-247510806404649\" -Force -Recurse -ErrorAction SilentlyContinue }\r\nAn exception occurred during task execution. The full traceback is:\r\nAt C:\\Users\\vagrant\\AppData\\Local\\Temp\\ansible-tmp-1479487487.3-247510806404649\\win_robocopy.ps1:392 char:41\r\n+ Set-Attr $result.win_robocopy \"changed\" $changed\r\n+                                         ~~~~~~~~\r\nfatal: [ids-server-local]: FAILED! => {\r\n    \"changed\": false,\r\n    \"failed\": true,\r\n    \"invocation\": {\r\n        \"module_name\": \"win_robocopy\"\r\n    },\r\n```\r\nAfter\r\n```\r\n-------------------------------------------------------------------------------\r\n   ROBOCOPY     ::     Robust File Copy for Windows                              \r\n-------------------------------------------------------------------------------\r\n\r\n  Started : November 22, 2016 9:34:47 AM\r\n   Source : C:\\install\r\n     Dest : C:\\install.bak\r\n\r\n    Files : *.*\r\n\t    \r\n  Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /R:1000000 /W:30 \r\n\r\n------------------------------------------------------------------------------\r\n\r\n\t                   1\tC:\\install\\\r\n\r\n------------------------------------------------------------------------------\r\n\r\n               Total    Copied   Skipped  Mismatch    FAILED    Extras\r\n    Dirs :         1         0         0         0         0         0\r\n   Files :         1         0         0         0         0         0\r\n   Bytes :    1.08 m         0    1.08 m         0         0         0\r\n   Times :   0:00:00   0:00:00                       0:00:00   0:00:00\r\n   Ended : November 22, 2016 9:34:47 AM\r\n```\r\n\r\nAdd $changed = false default value to solve \"The variable '$changed' cannot be retrieved because it has not been set.\" error","created_at":"2016-11-22T14:37:49Z","updated_at":"2016-11-22T14:37:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/3515/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/3515/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3515/comments","statuses_url":"https://api.github.com/repos/ansible/ansible-modules-extras/statuses/093b84761a72e7221ba6a263060ad38b9a44789b","head":{"label":"twistyWater:devel","ref":"devel","sha":"093b84761a72e7221ba6a263060ad38b9a44789b","user":{"login":"twistyWater","id":23435967,"avatar_url":"https://avatars.githubusercontent.com/u/23435967?v=3","gravatar_id":"","url":"https://api.github.com/users/twistyWater","html_url":"https://github.com/twistyWater","followers_url":"https://api.github.com/users/twistyWater/followers","following_url":"https://api.github.com/users/twistyWater/following{/other_user}","gists_url":"https://api.github.com/users/twistyWater/gists{/gist_id}","starred_url":"https://api.github.com/users/twistyWater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twistyWater/subscriptions","organizations_url":"https://api.github.com/users/twistyWater/orgs","repos_url":"https://api.github.com/users/twistyWater/repos","events_url":"https://api.github.com/users/twistyWater/events{/privacy}","received_events_url":"https://api.github.com/users/twistyWater/received_events","type":"User","site_admin":false},"repo":{"id":74479832,"name":"ansible-modules-extras","full_name":"twistyWater/ansible-modules-extras","owner":{"login":"twistyWater","id":23435967,"avatar_url":"https://avatars.githubusercontent.com/u/23435967?v=3","gravatar_id":"","url":"https://api.github.com/users/twistyWater","html_url":"https://github.com/twistyWater","followers_url":"https://api.github.com/users/twistyWater/followers","following_url":"https://api.github.com/users/twistyWater/following{/other_user}","gists_url":"https://api.github.com/users/twistyWater/gists{/gist_id}","starred_url":"https://api.github.com/users/twistyWater/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twistyWater/subscriptions","organizations_url":"https://api.github.com/users/twistyWater/orgs","repos_url":"https://api.github.com/users/twistyWater/repos","events_url":"https://api.github.com/users/twistyWater/events{/privacy}","received_events_url":"https://api.github.com/users/twistyWater/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/twistyWater/ansible-modules-extras","description":"Ansible extra modules - these modules ship with ansible","fork":true,"url":"https://api.github.com/repos/twistyWater/ansible-modules-extras","forks_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/forks","keys_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/teams","hooks_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/hooks","issue_events_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/issues/events{/number}","events_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/events","assignees_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/assignees{/user}","branches_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/branches{/branch}","tags_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/tags","blobs_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/git/refs{/sha}","trees_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/statuses/{sha}","languages_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/languages","stargazers_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/stargazers","contributors_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/contributors","subscribers_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/subscribers","subscription_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/subscription","commits_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/commits{/sha}","git_commits_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/git/commits{/sha}","comments_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/comments{/number}","issue_comment_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/issues/comments{/number}","contents_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/contents/{+path}","compare_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/merges","archive_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/downloads","issues_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/issues{/number}","pulls_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/pulls{/number}","milestones_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/milestones{/number}","notifications_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/labels{/name}","releases_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/releases{/id}","deployments_url":"https://api.github.com/repos/twistyWater/ansible-modules-extras/deployments","created_at":"2016-11-22T14:21:25Z","updated_at":"2016-11-22T14:21:31Z","pushed_at":"2016-11-22T14:25:36Z","git_url":"git://github.com/twistyWater/ansible-modules-extras.git","ssh_url":"git@github.com:twistyWater/ansible-modules-extras.git","clone_url":"https://github.com/twistyWater/ansible-modules-extras.git","svn_url":"https://github.com/twistyWater/ansible-modules-extras","homepage":"","size":56563,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"296cee682af4ec169e586c4c3b4a293a191d1029","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","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":24474138,"name":"ansible-modules-extras","full_name":"ansible/ansible-modules-extras","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars.githubusercontent.com/u/1507452?v=3","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-modules-extras","description":"Ansible extra modules - these modules ship with ansible","fork":false,"url":"https://api.github.com/repos/ansible/ansible-modules-extras","forks_url":"https://api.github.com/repos/ansible/ansible-modules-extras/forks","keys_url":"https://api.github.com/repos/ansible/ansible-modules-extras/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible-modules-extras/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible-modules-extras/teams","hooks_url":"https://api.github.com/repos/ansible/ansible-modules-extras/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/events","assignees_url":"https://api.github.com/repos/ansible/ansible-modules-extras/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible-modules-extras/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible-modules-extras/tags","blobs_url":"https://api.github.com/repos/ansible/ansible-modules-extras/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible-modules-extras/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible-modules-extras/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible-modules-extras/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible-modules-extras/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible-modules-extras/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible-modules-extras/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible-modules-extras/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible-modules-extras/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible-modules-extras/subscription","commits_url":"https://api.github.com/repos/ansible/ansible-modules-extras/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible-modules-extras/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible-modules-extras/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible-modules-extras/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible-modules-extras/merges","archive_url":"https://api.github.com/repos/ansible/ansible-modules-extras/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible-modules-extras/downloads","issues_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible-modules-extras/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible-modules-extras/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible-modules-extras/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/deployments","created_at":"2014-09-25T20:28:42Z","updated_at":"2016-11-21T13:16:28Z","pushed_at":"2016-11-22T14:35:45Z","git_url":"git://github.com/ansible/ansible-modules-extras.git","ssh_url":"git@github.com:ansible/ansible-modules-extras.git","clone_url":"https://github.com/ansible/ansible-modules-extras.git","svn_url":"https://github.com/ansible/ansible-modules-extras","homepage":"","size":56563,"stargazers_count":775,"watchers_count":775,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1644,"mirror_url":null,"open_issues_count":719,"forks":1644,"open_issues":719,"watchers":775,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/3515"},"html":{"href":"https://github.com/ansible/ansible-modules-extras/pull/3515"},"issue":{"href":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3515"},"comments":{"href":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3515/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/3515/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/3515/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible-modules-extras/statuses/093b84761a72e7221ba6a263060ad38b9a44789b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":1,"deletions":0,"changed_files":1}}
{"actor":{"display_login":"twistyWater"}}