This is a two-fold question.
In scenarios where the git repository is not publicly accessible, can I deploy from a local machine (that also runs Ansible) to a remove host using the local copy of the repository on my hard drive (or a copy on the master server, for example)?
If the answer to the previous question is yes, is the git module used for this purpose?
EDIT:
What I've tried thus far:
The dir structure as follows:
repo/
|-.git/
|-deploy/
| |-inventory
| |-roles/
| | \-app/
| | \-main.yml
| \-vagrant.yml
\-src/
playbook contains:
- name: Clone local application
git: repo={{ inventory_dir }}/../
dest=/home/{{ application_name }}/code
Deploying this to a vagrant box via SSH results in:
fatal: [vagrant]: FAILED! => {
"changed": false,
"cmd": "/usr/bin/git clone --origin origin path/to/repo",
"failed": true,
"msg": "Cloning into '/home/app/code'...\nfatal:
'path/to/repo' does not appear to be a git repository\nfatal:
Could not read from remote repository.\n\nPlease make sure you
have the correct access rights\nand the repository exists.",
...}