# Suggestions for win\_copy and win\_ansible

**URL:** <https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495>\
**Category:** Ansible Developer\
**Tags:** windows\
**Created:** [October 13, 2014, 10:06pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495 "2014-10-13T22:06:41Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [December 9, 2014, 11:55pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/21 "2014-12-09T23:55:55Z")

</div>

Just to say I rebased [https://github.com/ansible/ansible/pull/9611](https://github.com/ansible/ansible/pull/9611)  
Sorry its taken a while to get to it.

Jon

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [December 17, 2014, 9:33am UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/22 "2014-12-17T09:33:49Z")

</div>

Just in case anyone is following this thread, win\_copy, win\_file and win\_template have now been merged into dev.  
Thanks everyone.  
Jon

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [December 17, 2014, 5:43pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/23 "2014-12-17T17:43:03Z")

</div>

Yeah we just had a discussion about this.

I think we’re going to (temporarily) un-merge, and look into the copy-paste code de-duplication first.

(They were also merged into -core, and really should be -extras first, which mostly was because the PRs were made to the wrong spots)

---

<div class="post-metadata">

**Author:** ![Guillaume\_Belrose](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@Guillaume\_Belrose](https://forum.ansible.com/u/Guillaume_Belrose)\
**Post date:** [January 5, 2015, 7:42am UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/24 "2015-01-05T07:42:19Z")

</div>

Hi all,

I apologize in advance for the dumb question. I’ve been tasked at work to look at supporting Windows servers with Ansible. I started simple by trying to configure and install CouchDB on Windows. So far I like the agent-less model.

I now need to be able to upload files and tweak configurations via the template module. Which Ansible branch can I look at to try the win\_copy, win\_file and win\_template modules?

I’ve tried the devel branch (at commit 1698b17b1475e833b3b2930d723e047d7ff36b9e ) but it does not seem to contain the modules that I am looking for.  
I am getting an error like: ERROR: win\_copy is not a legal parameter in an Ansible task or handler  
I am sure this is a stupid configuration error from my part, but I can’t work out how to make it work ( my Python and PowerShell scripts are not very good I am afraid).

Thanks in advance,

Guillaume.

---

<div class="post-metadata">

**Author:** ![Phil\_Schwartz](https://avatars.discourse-cdn.com/v4/letter/p/e47774/32.png) [@Phil\_Schwartz](https://forum.ansible.com/u/Phil_Schwartz)\
**Post date:** [January 5, 2015, 5:07pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/25 "2015-01-05T17:07:08Z")

</div>

Hi Guillaume,

The win\_copy module was reverted and pull out of the repos. So you most likely cannot find it now. I had tested it at some point and could not get it to work.

However, I am still very curious about this module because it would be so useful. Is there any word on the latest of this module development? I’d like to see the source, maybe even pull it into devel at ansible-modules-extras so that others could contribute to it and test.

It was only in the repo for a couple days before being merged into core and then reverted like the next day.

Thanks,

Phil

---

<div class="post-metadata">

**Author:** ![Janaka\_Abeywardhana1](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Janaka\_Abeywardhana1](https://forum.ansible.com/u/Janaka_Abeywardhana1)\
**Post date:** [January 5, 2015, 5:30pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/26 "2015-01-05T17:30:02Z")

</div>

Hi,

+1

I’m also interested in this and might get some time to help test so I +1 for having it on a branch.

Thanks

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [January 5, 2015, 6:28pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/27 "2015-01-05T18:28:27Z")

</div>

We’re not going to likely hit this until the ‘v2’ tree is complete, as we do think it needs to inherit from other modules, but we need to take time to look at the architecture of how this is implemented in the new tree.

---

<div class="post-metadata">

**Author:** ![Guillaume\_Belrose](https://avatars.discourse-cdn.com/v4/letter/g/3d9bf3/32.png) [@Guillaume\_Belrose](https://forum.ansible.com/u/Guillaume_Belrose)\
**Post date:** [January 7, 2015, 4:43am UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/28 "2015-01-07T04:43:15Z")

</div>

Thanks for the update Michael.

For the time being, I am applying the template locally (on the Linux ‘master’ node) and I serve the template output via a web server using the win\_get\_url module. It feels a bit like a hack, but it actually works quite well.  
Is there a time frame for the completion of the v2 tree?

Cheers,

Guillaume.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [January 7, 2015, 2:56pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/29 "2015-01-07T14:56:59Z")

</div>

Yep!

v2 is going to be done for 1.9 (undecided on whether we call this a “2.0”, but our goal is to have it 99.X% compatible) … we hope to have it in a state where people can help test and contribute to it in a month or so (approximately).

–Michael

---

<div class="post-metadata">

**Author:** ![Martin\_Etmajer](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Martin\_Etmajer](https://forum.ansible.com/u/Martin_Etmajer)\
**Post date:** [March 18, 2015, 8:01am UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/30 "2015-03-18T08:01:09Z")

</div>

Hi!

1.9 rc1 has just been released on GitHub, but I don’t see any extra windows modules shipping with it. Is there any update on your “schedule”?

Thanks, Martin

---

<div class="post-metadata">

**Author:** ![Janaka\_Abeywardhana1](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Janaka\_Abeywardhana1](https://forum.ansible.com/u/Janaka_Abeywardhana1)\
**Post date:** [March 18, 2015, 8:41am UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/31 "2015-03-18T08:41:09Z")

</div>

I would also like to know when this stuff will be out please.

– Sent from a mobile device –

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [March 19, 2015, 10:29am UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/32 "2015-03-19T10:29:25Z")

</div>

My understanding is this.

The plan was to tackle the common logic issue (specifically so that template and win\_template can share as much code as it makes sense to share and any other action plugins that we may well want to have different implementations of for windows) in the v2 codebase. 1.9 is still using the older codebase.

So when 1.9 is released and v2 becomes the current development version this can be tackled.

That said, the win\_copy and win\_template action plugins have been merged into 1.9 rc so that the action plugins can be worked on once v2 is there to support the necessary changes.

This means that if you really want to try win\_copy / win\_file / win\_template you can grab them from [https://github.com/ansible/ansible-modules-core/pull/384](https://github.com/ansible/ansible-modules-core/pull/384) into your /etc/ansible/library. Obviously these may well change and you may or may not have to fix your playbooks to work with the supported versions.

If you do try this, be aware of the following.

If you need windows line endings (\r \n)  
1/ put the following on the first line of your template:

#jinja2: newline\_sequence:‘\r\n’

2/ If your template file was created on a windows machine, remove the byte order mark if present (will be the first hidden character of the file) as this trips up Ansible. You can see if this is present using od -cx

Jon

---

<div class="post-metadata">

**Author:** ![John\_Jelinek](https://avatars.discourse-cdn.com/v4/letter/j/5f9b8f/32.png) [@John\_Jelinek](https://forum.ansible.com/u/John_Jelinek)\
**Post date:** [May 1, 2015, 5:34pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/33 "2015-05-01T17:34:06Z")

</div>

v2 is now in active development, but u don't see mention of win\_copy/file/template in the CHANGELOG. Any updates whether this will get integrated?

---

<div class="post-metadata">

**Author:** ![Miguel\_Cantu](https://avatars.discourse-cdn.com/v4/letter/m/d2c977/32.png) [@Miguel\_Cantu](https://forum.ansible.com/u/Miguel_Cantu)\
**Post date:** [May 11, 2015, 7:09pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/34 "2015-05-11T19:09:14Z")

</div>

+1. It would be great seeing these modules pulled in.

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [June 11, 2015, 8:24pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/35 "2015-06-11T20:24:22Z")

</div>

In case anyone is still watching this thread, win\_copy, win\_file and win\_template have now been merged into latest devel.

Jon

---

<div class="post-metadata">

**Author:** ![Janaka\_Abeywardhana1](https://avatars.discourse-cdn.com/v4/letter/j/b2d939/32.png) [@Janaka\_Abeywardhana1](https://forum.ansible.com/u/Janaka_Abeywardhana1)\
**Post date:** [June 12, 2015, 8:48am UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/36 "2015-06-12T08:48:10Z")

</div>

Nice!

---

<div class="post-metadata">

**Author:** ![Bob\_Tanner](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Bob\_Tanner](https://forum.ansible.com/u/Bob_Tanner)\
**Post date:** [June 12, 2015, 10:13pm UTC](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495/37 "2015-06-12T22:13:49Z")

</div>

Did it get back ported to v1?

`$ find . -name "win_copy*" ./lib/ansible/modules/core/windows/win_copy.ps1 ./lib/ansible/modules/core/windows/win_copy.py ./v1/ansible/modules/core/windows/win_copy.ps1 ./v1/ansible/modules/core/windows/win_copy.py ./v1/ansible/runner/action_plugins/win_copy.py`

[Previous page](https://forum.ansible.com/t/suggestions-for-win-copy-and-win-ansible/16495.md?page=1)
