perniciouscaffeine perniciouscaffeine - 1 year ago 158
Git Question

How to have Ansible Git install into an existing directory

Attempting to repetitively git clone deploy into a common directory, but getting errors "/www' already exists and is not an empty directory".

fatal: []: FAILED! => {"changed": false, "cmd": "/usr/bin/git clone --origin origin /www", "failed": true, "msg": "fatal: destination path '/www' already exists and is not an empty directory.", "rc": 128, "stderr": "fatal: destination path '/www' already exists and is not an empty directory.\n", "stdout": "", "stdout_lines": []}

sections from playbook:

- website_dir: /www
- name: Deploy Code From Github
dest={{ website_dir }}/

perms for the deploy directory. The deploy is currently as ubuntu.

root@ip-172-30-0-219:~# ls -al /www
total 12
drwxrwxr-x 2 ubuntu www-data 4096 Nov 14 04:43 .
drwxr-xr-x 24 root root 4096 Nov 14 04:33 ..
-rw-r--r-- 1 ubuntu www-data 27 Nov 14 04:43 DATA_VARIABLES

Answer Source

dest parameter of git module is a destination directory, not the directory one step above:

Absolute path of where the repository should be checked out to.

You should use:

dest={{ website_dir }}/PHP-Algos
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download