files from .gitignore not found

Hi there! I want to use git-project in Ansible tower. I successfully created Git Project and template based on role /roles/mytest/. However I dont want to store /roles/mytest/files in the github, so I created /roles/mytest/files/.gitignore.

Then I created manually file test.txt in the folder /var/lib/awx/projects/_8__test_git/roles/mytest/files/. Then I start playbook:

  • name: list files
    local_action: command ls -Ra ./
    register: zzz

  • name: debug
    debug:
    msg: “{{zzz.stdout_lines}}”

Unfortunally, file test.txt wasn’t found in result list. What can I do? I want to use git, but I dont want to store any folders (such as /files/, etc) in the git. Thanks!