Ansible : Git module clone of repository while re-run is throwing exception -
i using ansible-playbook setup server, cloning repo github. while re-running play-book, getting exception msg: fatal: destination path '/webapps/........' exists , not empty directory.
task: [web | setup git repo] ********************************************** failed: [192.168.1.96] => {"cmd": "/usr/bin/git clone --origin origin --branch master https://github.com/....../......git /webapps/....../...../....", "failed": true, "rc": 128} stderr: fatal: destination path '/webapps/..../..../....' exists , not empty directory. msg: fatal: destination path '/webapps/..../..../....' exists , not empty directory. fatal: hosts have failed -- aborting
playbook
- name: setup git repo git: repo={{ git_repo }} version="{{ git_branch }}" dest={{ project_path }} accept_hostkey=yes force=yes when: setup_git_repo defined , setup_git_repo tags: git - name: delete .pyc files command: find . -name '*.pyc' -delete args: chdir: "{{ project_path }}" tags: git
how skip step (or) over-write files, if files cloned , exists in server.?.
why don't remove folder before clone it? http://docs.ansible.com/ansible/shell_module.html
- shell: rm -fr /yourfolder
Comments
Post a Comment