Another interesting thing is, while the script by itself executes in 
powershell. the encoded command fails.

The following command runs successfully.

PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File 
"C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1407796059.19-71256379326746\\win_get_url.ps1"
 
"C:\Users\Administrator\AppData\Local\Temp\ansible-tmp-1407796059.19-71256379326746\\arguments"

This one passing the encoded command fails.

PowerShell -NoProfile -NonInteractive -EncodedCommand 
'UABvAHcAZQByAFMAaABlAGwAbAAgAC0ATgBvAFAAcgBvAGYAaQBsAGUAIAAtAE4AbwBuAEkAbgB0AGUAcgBhAGMAdABpAHYAZQAgAC0ARQB4AGUAYwB1AHQAaQBvAG4AUABvAGwAaQBjAHkAIABVAG4AcgBlAHMAdAByAGkAYwB0AGUAZAAgAC0ARgBpAGwAZQAgACIAQwAAAAAAAAA6AAAAAAAAAFwAAAAAAAAAVQAAAAAAAABzAAAAAAAAAGUAAAAAAAAAcgAAAAAAAABzAAAAAAAAAFwAAAAAAAAAQQAAAAAAAABkAAAAAAAAAG0AAAAAAAAAaQAAAAAAAABuAAAAAAAAAGkAAAAAAAAAcwAAAAAAAAB0AAAAAAAAAHIAAAAAAAAAYQAAAAAAAAB0AAAAAAAAAG8AAAAAAAAAcgAAAAAAAABcAAAAAAAAAEEAAAAAAAAAcAAAAAAAAABwAAAAAAAAAEQAAAAAAAAAYQAAAAAAAAB0AAAAAAAAAGEAAAAAAAAAXAAAAAAAAABMAAAAAAAAAG8AAAAAAAAAYwAAAAAAAABhAAAAAAAAAGwAAAAAAAAAXAAAAAAAAABUAAAAAAAAAGUAAAAAAAAAbQAAAAAAAABwAAAAAAAAAFwAAAAAAAAAYQAAAAAAAABuAAAAAAAAAHMAAAAAAAAAaQAAAAAAAABiAAAAAAAAAGwAAAAAAAAAZQAAAAAAAAAtAAAAAAAAAHQAAAAAAAAAbQAAAAAAAABwAAAAAAAAAC0AAAAAAAAAMQAAAAAAAAA0AAAAAAAAADAAAAAAAAAANwAAAAAA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AAAANgAAAAAAAAAwAAAAAAAAADUAAAAAAAAAOQAAAAAAAAAuAAAAAAAAADEAAAAAAAAAOQAAAAAAAAAtAAAAAAAAADcAAAAAAAAAMQAAAAAAAAAyAAAAAAAAADUAAAAAAAAANgAAAAAAAAAzAAAAAAAAADcAAAAAAAAAOQAAAAAAAAAzAAAAAAAAADIAAAAAAAAANgAAAAAAAAA3AAAAAAAAADQAAAAAAAAANgAAAAAAAABcAAAAAAAAAFwAAAAAAAAAYQAAAAAAAAByAAAAAAAAAGcAAAAAAAAAdQAAAAAAAABtAAAAAAAAAGUAAAAAAAAAbgAAAAAAAAB0AAAAAAAAAHMAAAAAAAAAIgA='

When decoded to base64, the string is same as the above command.

On Tuesday, August 12, 2014 6:24:43 AM UTC-5, Michael DeHaan wrote:
>
> I actually don't know this question as I'm not enough of a powershell 
> expert.
>
> Anyone else want to try and field this one?
>
>
>
>
> On Mon, Aug 11, 2014 at 6:14 PM, Gopinath Suryadevara <
> [email protected] <javascript:>> wrote:
>
>> Michael,
>>
>> Thank you for looking into this. How do i find how to make this work? The 
>> same script runs clean and copies the share when i execute via powershell. 
>> with ansible, I am able to copy files from local drives on the win machine. 
>> Does authentication mechanism has anything to do with this? say if NTLM was 
>> used instead of basic or keberos?
>>
>>
>> On Monday, August 11, 2014 5:05:38 PM UTC-5, Michael DeHaan wrote:
>>
>>> win_get_url was originally implemented to only support http://, though 
>>> I'm a bit surprised it doesn't do a bit more.
>>>
>>> http://docs.ansible.com/win_get_url_module.html
>>>
>>> We should note this in the docs, or better, upgrade it to support 
>>> network resources as well.
>>>
>>> https://github.com/ansible/ansible/blob/devel/library/
>>> windows/win_get_url.ps1
>>>
>>> So it's using Powershell DownloadFile here:
>>>
>>> http://msdn.microsoft.com/en-us/library/ez801hhe(v=vs.110).aspx
>>>
>>> Thoughts?
>>>
>>> I'll clearly admit to mostly be, ahem, orchestrating, the development of 
>>> modules in this space :)
>>>
>>>
>>>
>>>  
>>>
>>> On Mon, Aug 11, 2014 at 11:35 AM, Gopinath Suryadevara <
>>> [email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> I was able to connect to a windows 7 box from a RHEL 5, ping it and 
>>>> also changed the authentication to kerberos. Thank you, @Trond for the 
>>>> wonderful script. Both the machines are on the same domain. When I use the 
>>>> win_get_url module to copy a file from a network share, it fails. I turned 
>>>> on the traces, got hold of the scripts on the remote win machine using 
>>>> ANSIBLE_KEEP_FILES=1. When i execute the script on remote win machine 
>>>> using 
>>>> the arguments file created by ansible, it executes successfully and copies 
>>>> the file from a network share. But the script fails when run via ansible. 
>>>> Even when i map the network share and try to use the assigned drive 
>>>> letter, 
>>>> the script fails when executed from the ansible linux controller.
>>>>
>>>> Any help on this is appreciated!!
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Ansible Project" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>>
>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>> msgid/ansible-project/5d68d0ff-6d91-456c-b492-
>>>> 93f9545e8e6c%40googlegroups.com 
>>>> <https://groups.google.com/d/msgid/ansible-project/5d68d0ff-6d91-456c-b492-93f9545e8e6c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/292dd34e-9be4-4f19-bfad-7cc1e58a1bec%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/292dd34e-9be4-4f19-bfad-7cc1e58a1bec%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/41ae0f7f-8dbb-4d41-bfa9-7d5e861835f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to