If you are not familiar with modules, check out Ansible - Getting Started with Modules.
The git module does not support common git tasks such as git add, git remove, and git commit. The shell module can be used to perform these other git tasks.
- name: add bar.txt to foo.git
shell: git add bar.txt
args:
chdir: /path/to/cloned/git/repo
AVOID TROUBLE
If "peer's certificate issuer is not recognized" is being returned, the GIT_SSL_NO_VERIFY variable can be set to true before issuing a git command.
- name: add bar.txt to foo.git
shell: export GIT_SSL_NO_VERIFY=true; git add bar.txt
args:
chdir: /path/to/cloned/git/repo