title: Ansible Recursive Directory Copy
body: <p>Ansible version: 2.2.1.0</p>
  
  <p>I'm having trouble copying the contents of a directory to a destination host in Ansible. My role directory structure looks like this:</p>
  
  <pre><code>roles/server/
  ├── defaults
  │   └── main.yml
  ├── files
  │   ├── Common-x86_64.repo
  │   ├── docker-ce-stable.repo
  |
  ├── handlers
  │   └── main.yml
  ├── meta
  │   └── main.yml
  ├── README.md
  ├── tasks
  │   ├── main.yml
  │   └── packages.yml
  ├── templates
  ├── tests
  │   ├── inventory
  │   └── test.yml
  └── vars
      └── main.yml
  </code></pre>
  
  <p>There are a lot (about 12 more) repos in the files directory, I've omitted most for the sake of keeping it short. I'm running this code in <code>packages.yml</code></p>
  
  <pre><code>- name: 1. Setup Repos
       file:
         src: files/
         dest: /etc/yum.repos.d/
         owner: root
         group: root
         mode: 0644
  </code></pre>
  
  <p>Even though the task is completing without error, nothing is copying into <code>/etc/yum.repos.d/</code> on the target machine:</p>
  
  <pre><code>ls /etc/yum.repos.d/
  CentOS-Base.repo       CentOS-Media.repo    CentOS-fasttrack.repo
  CentOS-CR.repo         CentOS-Sources.repo
  CentOS-Debuginfo.repo  CentOS-Vault.repo
  </code></pre>
  
  <p>I read on the documentation page that ending a source directory with a <code>/</code> causes the contents to be copied recursively. What am I doing wrong?</p>