{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5704","repository_url":"https://api.github.com/repos/ansible/ansible-modules-core","labels_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5704/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5704/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5704/events","html_url":"https://github.com/ansible/ansible-modules-core/issues/5704","id":191158376,"number":5704,"title":"win_file is pre-appending user local directory when given absolute path","user":{"login":"suryajak","id":9021084,"avatar_url":"https://avatars.githubusercontent.com/u/9021084?v=3","gravatar_id":"","url":"https://api.github.com/users/suryajak","html_url":"https://github.com/suryajak","followers_url":"https://api.github.com/users/suryajak/followers","following_url":"https://api.github.com/users/suryajak/following{/other_user}","gists_url":"https://api.github.com/users/suryajak/gists{/gist_id}","starred_url":"https://api.github.com/users/suryajak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suryajak/subscriptions","organizations_url":"https://api.github.com/users/suryajak/orgs","repos_url":"https://api.github.com/users/suryajak/repos","events_url":"https://api.github.com/users/suryajak/events{/privacy}","received_events_url":"https://api.github.com/users/suryajak/received_events","type":"User","site_admin":false},"labels":[{"id":454885373,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/affects_2.3","name":"affects_2.3","color":"5319e7","default":false},{"id":132571937,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":132897312,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/needs_info","name":"needs_info","color":"eb6420","default":false},{"id":132897414,"url":"https://api.github.com/repos/ansible/ansible-modules-core/labels/windows","name":"windows","color":"777777","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-23T00:02:26Z","updated_at":"2016-12-07T20:38:48Z","closed_at":null,"body":"<!--- Verify first that your issue/request is not already reported in GitHub -->\r\n\r\n##### ISSUE TYPE\r\n<!--- Pick one below and delete the rest: -->\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\n<!--- Name of the plugin/module/task -->\r\nwin_file\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from “ansible --version” between quotes below -->\r\n```\r\nansible 2.3.0\r\n```\r\n\r\n##### CONFIGURATION\r\n<!---\r\nMention any settings you have changed/added/removed in ansible.cfg\r\n(or using the ANSIBLE_* environment variables).\r\n-->\r\n\r\n##### OS / ENVIRONMENT\r\n<!---\r\nOS: OS Sierra\r\nTarget: Windows Server 2012 \r\n-->\r\n\r\n##### SUMMARY\r\n<!--- Explain the problem briefly -->\r\nTrying to create a directory using win_file is failing. The error messages seems to indicate that the user local directory is getting pre-appended. Even then it should have successfully created the directory but it failed\r\n##### STEPS TO REPRODUCE\r\n<!---\r\nRun playbook targeting a windows machine\r\n-->\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```\r\n---\r\n- name: Create folder \r\n  hosts: sm \r\n\r\n  tasks:\r\n\r\n    - name: Create common file and directories\r\n     # chocolatey install folder \r\n      win_file: path=C:\\test\\tmp state=directory\r\n\r\n```\r\n\r\n<!--- You can also paste gist.github.com links for larger files -->\r\n\r\n##### EXPECTED RESULTS\r\nExpected it to create directory\r\n##### ACTUAL RESULTS\r\n<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->\r\nFailed to create directory and spit out the following error message:\r\n\r\n<!--- Paste verbatim command output between quotes below -->\r\n```\r\nTASK [Create common file and directories] **************************************\r\nAn exception occurred during task execution. To see the full traceback, use -vvv. The error was: +     ~~~~~~~~~~~~~~~\r\nfatal: [syntrafficsvc.cloudapp.net]: FAILED! => {\"changed\": false, \"error_record\": {\"CategoryInfo\": {\"Activity\": \"Test-Path\", \"Category\": 5, \"Reason\": \"ArgumentException\", \"TargetName\": \"C:\\\\Users\\\\suryaj\\\\\\test\\tmp\", \"TargetType\": \"String\"}, \"ErrorDetails\": null, \"Exception\": {\"Data\": {}, \"HResult\": -2147024809, \"HelpLink\": null, \"InnerException\": null, \"Message\": \"Illegal characters in path.\", \"ParamName\": null, \"Source\": \"mscorlib\", \"StackTrace\": \"   at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)\\r\\n   at System.IO.Path.GetFileName(String path)\\r\\n   at System.Management.Automation.Utils.IsReservedDeviceName(String destinationPath)\\r\\n   at System.Management.Automation.Utils.NativeItemExists(String path, Boolean& isDirectory, Exception& exception)\\r\\n   at Microsoft.PowerShell.Commands.FileSystemProvider.ItemExists(String path, ErrorRecord& error)\", \"TargetSite\": {\"Attributes\": 147, \"CallingConvention\": 1, \"ContainsGenericParameters\": false, \"CustomAttributes\": \"\", \"DeclaringType\": \"System.IO.Path\", \"IsAbstract\": false, \"IsAssembly\": true, \"IsConstructor\": false, \"IsFamily\": false, \"IsFamilyAndAssembly\": false, \"IsFamilyOrAssembly\": false, \"IsFinal\": false, \"IsGenericMethod\": false, \"IsGenericMethodDefinition\": false, \"IsHideBySig\": true, \"IsPrivate\": false, \"IsPublic\": false, \"IsSecurityCritical\": false, \"IsSecuritySafeCritical\": false, \"IsSecurityTransparent\": true, \"IsSpecialName\": false, \"IsStatic\": true, \"IsVirtual\": false, \"MemberType\": 8, \"MetadataToken\": 100669450, \"MethodHandle\": \"System.RuntimeMethodHandle\", \"MethodImplementationFlags\": 0, \"Module\": \"CommonLanguageRuntimeLibrary\", \"Name\": \"CheckInvalidPathChars\", \"ReflectedType\": \"System.IO.Path\", \"ReturnParameter\": \"Void \", \"ReturnType\": \"void\", \"ReturnTypeCustomAttributes\": \"Void \"}}, \"FullyQualifiedErrorId\": \"ItemExistsArgumentError,Microsoft.PowerShell.Commands.TestPathCommand\", \"InvocationInfo\": {\"BoundParameters\": {}, \"CommandOrigin\": 1, \"DisplayScriptPosition\": null, \"ExpectingInput\": false, \"HistoryId\": 1, \"InvocationName\": \"Test-Path\", \"Line\": \"If (Test-Path $path)\\n\", \"MyCommand\": {\"CommandType\": 8, \"DefaultParameterSet\": \"Path\", \"Definition\": \"\\r\\nTest-Path [-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-PathType <TestPathType>] [-IsValid] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>]\\r\\n\\r\\nTest-Path -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-PathType <TestPathType>] [-IsValid] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>]\\r\\n\", \"HelpFile\": \"Microsoft.PowerShell.Commands.Management.dll-Help.xml\", \"ImplementingType\": \"Microsoft.PowerShell.Commands.TestPathCommand\", \"Module\": \"Microsoft.PowerShell.Management\", \"ModuleName\": \"Microsoft.PowerShell.Management\", \"Name\": \"Test-Path\", \"Noun\": \"Path\", \"Options\": 1, \"OutputType\": \"System.Boolean\", \"PSSnapIn\": null, \"ParameterSets\": \"[-Path] <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-PathType <TestPathType>] [-IsValid] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>] -LiteralPath <string[]> [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-PathType <TestPathType>] [-IsValid] [-Credential <pscredential>] [-UseTransaction] [<CommonParameters>]\", \"Parameters\": \"System.Collections.Generic.Dictionary`2[System.String,System.Management.Automation.ParameterMetadata]\", \"RemotingCapability\": 1, \"Verb\": \"Test\", \"Visibility\": 0}, \"OffsetInLine\": 5, \"PSCommandPath\": \"C:\\\\Users\\\\suryaj\\\\AppData\\\\Local\\\\Temp\\\\ansible-tmp-1479859154.27-88264525353830\\\\win_file.ps1\", \"PSScriptRoot\": \"C:\\\\Users\\\\suryaj\\\\AppData\\\\Local\\\\Temp\\\\ansible-tmp-1479859154.27-88264525353830\", \"PipelineLength\": 0, \"PipelinePosition\": 0, \"PositionMessage\": \"At C:\\\\Users\\\\suryaj\\\\AppData\\\\Local\\\\Temp\\\\ansible-tmp-1479859154.27-88264525353830\\\\win_file.ps1:312 char:5\\r\\n+ If (Test-Path $path)\\r\\n+     ~~~~~~~~~~~~~~~\", \"ScriptLineNumber\": 312, \"ScriptName\": \"C:\\\\Users\\\\suryaj\\\\AppData\\\\Local\\\\Temp\\\\ansible-tmp-1479859154.27-88264525353830\\\\win_file.ps1\", \"UnboundArguments\": []}, \"PSMessageDetails\": null, \"PipelineIterationInfo\": [], \"ScriptStackTrace\": \"at <ScriptBlock>, C:\\\\Users\\\\suryaj\\\\AppData\\\\Local\\\\Temp\\\\ansible-tmp-1479859154.27-88264525353830\\\\win_file.ps1: line 312\\r\\nat <ScriptBlock>, <No file>: line 4\", \"TargetObject\": \"C:\\\\Users\\\\suryaj\\\\\\test\\tmp\"}, \"failed\": true, \"msg\": \"Illegal characters in path.\"}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/comments/265566437","html_url":"https://github.com/ansible/ansible-modules-core/issues/5704#issuecomment-265566437","issue_url":"https://api.github.com/repos/ansible/ansible-modules-core/issues/5704","id":265566437,"user":{"login":"ansibot","id":6585283,"avatar_url":"https://avatars.githubusercontent.com/u/6585283?v=3","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T20:38:48Z","updated_at":"2016-12-07T20:38:48Z","body":"This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible\n\nPlease read through the <a href=\"http://docs.ansible.com/ansible/dev_guide/repomerge.html#move-issues-and-prs-to-new-repo\">repomerge</a> page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.\n\n<!-- boilerplate: repomerge -->"}}
{"actor":{"display_login":"ansibot"}}