Sorry, that should've been:

- win_copy:
    ... (whatever args to win_copy)
  become: yes
  become_method: runas
  become_user: "{{ ansible_user }}"
  vars:
    ansible_become_password: "{{ ansible_password }}"

On Thursday, March 23, 2017 at 5:54:55 PM UTC-7, Matt Davis wrote:
>
> The new Windows become stuff in 2.3 creates an "interactive" type logon 
> session, so credential caches and transparent multi-hop works- it should 
> take care of the auth issue (so it behaves like it would if you were 
> sitting in front of the machine). There's currently a bug that only allows 
> it to work under Basic and CredSSP (not NTLM/Kerb), but I'm hoping to have 
> that nailed down by 2.3RC2.
>
> Just do:
> - win_copy:
>     ... (whatever args to win_copy)
>   become: yes
>   become_method: runas
>   become_user: "{{ ansible_user }}"
>   become_password: "{{ ansible_password }}"
>
> This *should* take care of it for you...
>
> -Matt
>
>
> On Thursday, March 23, 2017 at 11:35:03 AM UTC-7, patrick korsnick wrote:
>>
>> Hi Jon,
>>
>> Thanks for the input. You're correct about the number of authentication 
>> hops- the client machine is not on a domain, but uses domain credentials to 
>> map the network share. So in the group_vars file there are only the 
>> non-domain credentials. I was able to use win_copy to copy a local file to 
>> another local file, but even after upgrading pywinrm to 0.2.0 and 
>> installing the credssp and re-running the ConfigureRemotingForAnsible.ps1 
>> script on the client with the credssp argument it still doesn't work. I'm 
>> thinking it's because I need to figure out how to pass it the credentials 
>> for the second-hop authentication.
>>
>> thanks again!
>> pat
>>
>> On Wednesday, March 22, 2017 at 11:30:49 PM UTC-6, J Hawkesworth wrote:
>>>
>>> Not tried it yet myself but can you establish if it works for a file 
>>> that isn't on a mapped drive first?
>>> If so then its possible you are getting into a second hop authentication 
>>> scenario (by default windows doesn't allow more than a single hop (ansible 
>>> controller -> windows box, but you may have 2 hops here (ansible -> windows 
>>> box -> mapped drive on another windows box).  There are ways around this 
>>> (either by using a domain user or credssp).  If you are already connecting 
>>> as a domain user, make sure you are using pywinrm==0.2.0 or later, and add 
>>> ansible_winrm_kerberos_delegation=true to the inventory vars for the 
>>> Windows host in question.
>>>
>>> If CredSSP is an option for you, you'll need to check your systems meet 
>>> the requirements (see 
>>> http://docs.ansible.com/ansible/intro_windows.html#credssp ) install 
>>> the requests-credssp library on your ansible controller and run the 
>>> ConfigureForRemoting.. script with the EnableCredSSP option as described 
>>> here: 
>>> http://docs.ansible.com/ansible/intro_windows.html#windows-system-prep 
>>>
>>> Please let us know how you get on.
>>>
>>> (oh and thanks for testing 2.3 Release candidate).
>>>
>>> Jon
>>>
>>> On Wednesday, March 22, 2017 at 11:16:29 PM UTC, patrick korsnick wrote:
>>>>
>>>> Hi all,
>>>>
>>>> Has anyone had any luck using the new in 2.3 feature of win_copy 
>>>> (remote_src) to copy files to/from a mapped network drive?  
>>>>
>>>> essentially I'm trying to do this:
>>>>
>>>> - name: copy from share
>>>>       win_copy:
>>>>         src: w:\foo
>>>>         dest: c:\
>>>>         remote_src: True
>>>>
>>>> and I get a message saying the src path doesn't exist. I tried using a 
>>>> UNC path instead of the drive letter also.
>>>>
>>>> The way I've been getting around this is to use a bat file that maps 
>>>> the drive and then does the copy, but I'd like to be able to do it with 
>>>> only the playbook and no bat file.
>>>>
>>>> Thanks for any input!
>>>>
>>>

-- 
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/0d7bfd90-4b7d-45e9-a6b2-03471b22a46d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to