<h5 dir="auto">Issue Type:</h5>
<p dir="auto">Bug Report</p>
<h5 dir="auto">Ansible Version:</h5>
<p dir="auto">Ansible devel (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/ansible/ansible/commit/e32d88760906da5ed473570218b5831292e0bfa8/hovercard" href="https://github.com/ansible/ansible/commit/e32d88760906da5ed473570218b5831292e0bfa8"><tt>e32d887</tt></a>)</p>
<h5 dir="auto">Ansible Configuration:</h5>
<p dir="auto">Standard <code class="notranslate">ansible.cfg</code></p>
<h5 dir="auto">Environment:</h5>
<p dir="auto">Debian, Ubuntu</p>
<h5 dir="auto">Summary:</h5>
<p dir="auto">Ansible converts strings <code class="notranslate">"yes"</code> and <code class="notranslate">"no"</code> into booleans <code class="notranslate">true</code> and <code class="notranslate">false</code> when it is not asked to. This can interfere when user wants to have literal strings <code class="notranslate">yes</code> or <code class="notranslate">no</code> passed through a variable.</p>
<h5 dir="auto">Steps To Reproduce:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
---
- hosts: localhost
  tasks:

    - name: Register fact
      set_fact:
        some_fact: 'yes'

    - name: Show fact as is
      debug: var=some_fact

    - name: Show fact filtered as bool
      debug: msg=&quot;{{ some_fact | bool }}&quot;

    - name: Show fact in string
      debug: msg=&quot;some_fact is {{ some_fact }}&quot;

    - name: Show fact in string as bool
      debug: msg=&quot;some_fact is {{ some_fact | bool }}&quot;
"><pre class="notranslate"><code class="notranslate">
---
- hosts: localhost
  tasks:

    - name: Register fact
      set_fact:
        some_fact: 'yes'

    - name: Show fact as is
      debug: var=some_fact

    - name: Show fact filtered as bool
      debug: msg="{{ some_fact | bool }}"

    - name: Show fact in string
      debug: msg="some_fact is {{ some_fact }}"

    - name: Show fact in string as bool
      debug: msg="some_fact is {{ some_fact | bool }}"

</code></pre></div>
<h5 dir="auto">Expected Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [localhost]

TASK: [Register fact] ********************************************************* 
ok: [localhost]

TASK: [Show fact as is] ******************************************************* 
ok: [localhost] =&gt; {
    &quot;var&quot;: {
        &quot;some_fact&quot;: &quot;yes&quot;
    }
}

TASK: [Show fact filtered as bool] ******************************************** 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;True&quot;
}

TASK: [Show fact in string] *************************************************** 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;some_fact is yes&quot;
}

TASK: [Show fact in string as bool] ******************************************* 
ok: [localhost] =&gt; {
    &quot;msg&quot;: &quot;some_fact is True&quot;
}
"><pre class="notranslate"><code class="notranslate">PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [localhost]

TASK: [Register fact] ********************************************************* 
ok: [localhost]

TASK: [Show fact as is] ******************************************************* 
ok: [localhost] =&gt; {
    "var": {
        "some_fact": "yes"
    }
}

TASK: [Show fact filtered as bool] ******************************************** 
ok: [localhost] =&gt; {
    "msg": "True"
}

TASK: [Show fact in string] *************************************************** 
ok: [localhost] =&gt; {
    "msg": "some_fact is yes"
}

TASK: [Show fact in string as bool] ******************************************* 
ok: [localhost] =&gt; {
    "msg": "some_fact is True"
}

</code></pre></div>
<h5 dir="auto">Actual Results:</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [Register fact] ***********************************************************
ok: [localhost]

TASK [Show fact as is] *********************************************************
ok: [localhost] =&gt; {
    &quot;changed&quot;: false, 
    &quot;some_fact&quot;: true
}

TASK [Show fact filtered as bool] **********************************************
ok: [localhost] =&gt; {
    &quot;changed&quot;: false, 
    &quot;msg&quot;: true
}

TASK [Show fact in string] *****************************************************
ok: [localhost] =&gt; {
    &quot;changed&quot;: false, 
    &quot;msg&quot;: &quot;some_fact is True&quot;
}

TASK [Show fact in string as bool] *********************************************
ok: [localhost] =&gt; {
    &quot;changed&quot;: false, 
    &quot;msg&quot;: &quot;some_fact is True&quot;
}"><pre class="notranslate"><code class="notranslate">PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [Register fact] ***********************************************************
ok: [localhost]

TASK [Show fact as is] *********************************************************
ok: [localhost] =&gt; {
    "changed": false, 
    "some_fact": true
}

TASK [Show fact filtered as bool] **********************************************
ok: [localhost] =&gt; {
    "changed": false, 
    "msg": true
}

TASK [Show fact in string] *****************************************************
ok: [localhost] =&gt; {
    "changed": false, 
    "msg": "some_fact is True"
}

TASK [Show fact in string as bool] *********************************************
ok: [localhost] =&gt; {
    "changed": false, 
    "msg": "some_fact is True"
}
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">win_copy</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2.3.2"><pre class="notranslate"><code class="notranslate">2.3.2
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Control node: Ubuntu 16<br>
Target node: Windows Server 2016</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">The documentation states that if the "src" parameter ends with a "/", then the contents of the directory is copied, not the directory itself. However, when using this together with "remote_src" the module seems to be broken.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Source folder layout:</p>
<div class="highlight highlight-source-powershell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="PS C:\Users\trond.hindenes&gt; ls F:\softwaredownload\nginx-1.13.3\nginx-1.13.3


    Directory: F:\softwaredownload\nginx-1.13.3\nginx-1.13.3


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        7/23/2017  10:24 AM                conf
d-----        7/23/2017  10:24 AM                contrib
d-----        7/23/2017  10:24 AM                docs
d-----        7/23/2017  10:24 AM                html
d-----        7/11/2017   4:30 PM                logs
d-----        7/11/2017   4:30 PM                temp
------        7/11/2017   4:28 PM        3066880 nginx.exe


PS C:\Users\trond.hindenes&gt;"><pre class="notranslate">PS C:\Users\trond.hindenes<span class="pl-k">&gt;</span> ls F:\softwaredownload\nginx<span class="pl-k">-</span><span class="pl-c1">1.13</span>.<span class="pl-c1">3</span>\nginx<span class="pl-k">-</span><span class="pl-c1">1.13</span>.<span class="pl-c1">3</span>


    Directory: F:\softwaredownload\nginx<span class="pl-k">-</span><span class="pl-c1">1.13</span>.<span class="pl-c1">3</span>\nginx<span class="pl-k">-</span><span class="pl-c1">1.13</span>.<span class="pl-c1">3</span>


Mode                LastWriteTime         Length Name
<span class="pl-k">----</span>                <span class="pl-k">-------------</span>         <span class="pl-k">------</span> <span class="pl-k">----</span>
d<span class="pl-k">-----</span>        <span class="pl-c1">7</span><span class="pl-k">/</span><span class="pl-c1">23</span><span class="pl-k">/</span><span class="pl-c1">2017</span>  <span class="pl-c1">10</span>:<span class="pl-c1">24</span> AM                conf
d<span class="pl-k">-----</span>        <span class="pl-c1">7</span><span class="pl-k">/</span><span class="pl-c1">23</span><span class="pl-k">/</span><span class="pl-c1">2017</span>  <span class="pl-c1">10</span>:<span class="pl-c1">24</span> AM                contrib
d<span class="pl-k">-----</span>        <span class="pl-c1">7</span><span class="pl-k">/</span><span class="pl-c1">23</span><span class="pl-k">/</span><span class="pl-c1">2017</span>  <span class="pl-c1">10</span>:<span class="pl-c1">24</span> AM                docs
d<span class="pl-k">-----</span>        <span class="pl-c1">7</span><span class="pl-k">/</span><span class="pl-c1">23</span><span class="pl-k">/</span><span class="pl-c1">2017</span>  <span class="pl-c1">10</span>:<span class="pl-c1">24</span> AM                html
d<span class="pl-k">-----</span>        <span class="pl-c1">7</span><span class="pl-k">/</span><span class="pl-c1">11</span><span class="pl-k">/</span><span class="pl-c1">2017</span>   <span class="pl-c1">4</span>:<span class="pl-c1">30</span> PM                logs
d<span class="pl-k">-----</span>        <span class="pl-c1">7</span><span class="pl-k">/</span><span class="pl-c1">11</span><span class="pl-k">/</span><span class="pl-c1">2017</span>   <span class="pl-c1">4</span>:<span class="pl-c1">30</span> PM                temp
<span class="pl-k">------</span>        <span class="pl-c1">7</span><span class="pl-k">/</span><span class="pl-c1">11</span><span class="pl-k">/</span><span class="pl-c1">2017</span>   <span class="pl-c1">4</span>:<span class="pl-c1">28</span> PM        <span class="pl-c1">3066880</span> <span class="pl-c1">nginx.exe</span>


PS C:\Users\trond.hindenes<span class="pl-k">&gt;</span></pre></div>
<p dir="auto">playbook:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="- name: copy nginx.exe to target dir
  win_copy:
    src: &quot;F:\\softwaredownload\\nginx-1.13.3\\nginx-1.13.3/&quot;
    dest: &quot;F:\\apps\\nginx&quot;
    remote_src: yes
    force: yes"><pre class="notranslate">- <span class="pl-ent">name</span>: <span class="pl-s">copy nginx.exe to target dir</span>
  <span class="pl-ent">win_copy</span>:
    <span class="pl-ent">src</span>: <span class="pl-s"><span class="pl-pds">"</span>F:<span class="pl-cce">\\</span>softwaredownload<span class="pl-cce">\\</span>nginx-1.13.3<span class="pl-cce">\\</span>nginx-1.13.3/<span class="pl-pds">"</span></span>
    <span class="pl-ent">dest</span>: <span class="pl-s"><span class="pl-pds">"</span>F:<span class="pl-cce">\\</span>apps<span class="pl-cce">\\</span>nginx<span class="pl-pds">"</span></span>
    <span class="pl-ent">remote_src</span>: <span class="pl-s">yes</span>
    <span class="pl-ent">force</span>: <span class="pl-s">yes</span></pre></div>
<p dir="auto">ansible <code class="notranslate">vvvv</code> output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="changed: [wpm-0101001] =&gt; {
    &quot;changed&quot;: true, 
    &quot;dest&quot;: &quot;F:\\apps\\nginx&quot;, 
    &quot;operation&quot;: &quot;folder_copy&quot;, 
    &quot;original_basename&quot;: null, 
    &quot;size&quot;: 3943932, 
    &quot;src&quot;: &quot;F:\\softwaredownload\\nginx-1.13.3\\nginx-1.13.3/&quot;
}
"><pre class="notranslate"><code class="notranslate">changed: [wpm-0101001] =&gt; {
    "changed": true, 
    "dest": "F:\\apps\\nginx", 
    "operation": "folder_copy", 
    "original_basename": null, 
    "size": 3943932, 
    "src": "F:\\softwaredownload\\nginx-1.13.3\\nginx-1.13.3/"
}

</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">The contents of <code class="notranslate">F:\\apps\\nginx</code> should be equal to the contents of <code class="notranslate">F:\\softwaredownload\\nginx-1.13.3\\nginx-1.13.3</code></p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">The root folder is also copied, so <code class="notranslate">F:\\apps\\nginx</code> only contains one folder, <code class="notranslate">nginx-1.13.3</code> (which again has the copied files)</p>