'Copy folder content with Ansible

For some weird reasons I'm having troubles with a simple task which is copying a content of the folder myfiles (few files in there) to the dist/myfiles location. Task looks like this:

name: Deploy config files like there is no tomorrow
copy:
  src: "{{ item }}"
  dest: "/home/{{ ansible_user_id }}/dist/{{ item }}"
with_items:
  - 'config'
  - 'myfiles/'

myfiles folder exist under the dist and config file is copied to the dist folder.

Is this possible in Ansible or I should copy each file separately? Am I doing it completely wrong?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source