Mr.DevEng
Mr.DevEng

Reputation: 2421

Folder already exist, but it is not a Subversion repository error in Ansible Subversion checkout

I am trying to checkout a SVN repository from my repository server using Ansible subversion module. I already configured one svn repository in my server. And I am trying to checkout that into my Ec2 machine using Ansible playbook and subversion module. But when I am running the playbook, I am getting the error that:

fatal: [localhost]: FAILED! => {"changed": false, "msg": "ERROR: ././ folder already exists, but its not a subversion repository."}

My Ansible role tasks contain the following:

- name: SVN checkout
  subversion:
   repo: <my-ip>/svn/test
   checkout: yes
   update: yes
   dest: ././

I am getting error like the following,

enter image description here

Updated Observation

When I am only exporting using " export: yes " option, it's properly working. The problem is only for checkout operation.

My confusion is that, Is there any problem for my checkout using above YML? Why only showing these type of error ? Since export also properly working.

Upvotes: 3

Views: 1084

Answers (1)

MGP
MGP

Reputation: 3031

In order to checkout to a non-empty folder you should be using in_place, this option was added in 2.6 release, specifically this PR.

Try addin in_place = yes to your option list.

- name: SVN checkout
  subversion:
   repo: <my-ip>/svn/test
   checkout: yes
   update: yes
   in_place: yes
   dest: ././

Double check if anything gets overwritten, this is doing a svn checkout --force under the hood.

2.6 docs

in_place default value: no

If the directory exists, then the working copy will be checked-out over-the-top using svn checkout --force; if force is specified then existing files with different content are reverted

Upvotes: 2

Related Questions