Thanks for replying Kai, if i understand you correctly , git module in
anisble doesnot create the parent directory for example if the playbook has
the below git play
 git: repo= git: repo=https://github.com/drush-ops/drush.git
dest=/data/gitfiles clone=yes ==> it will not create a drush directory
under /data/gitfiles...

and only when we run @command prompt #git clone
https://github.com/drush-ops/drush.git , it will create  a directory drush
under the present working directory as there was no directory mention...so
there is no way that we have that directory "drush" created under the
directory ...thanks for the help.

On Sat, Dec 9, 2017 at 3:13 PM, Kai Stian Olstad <
ansible-project+l...@olstad.com> wrote:

> On Saturday, 9 December 2017 06.14.14 CET coach.r...@gmail.com wrote:
> > I am trying to clone a git repository using the git clone command but it
> is
> > unable to create the directory structure and copies the entire files in
> the
> > parent directory.
> > example when i do the
> > - git: repo=http://pathtothegit/container.git dest=/data/config
> > recursive=yes ====> it only copies the files to the /data/config
> directory
> > it doesnot make the directory container under /data/config like
> > /data/config/container rather copies all the files under /data/config (
> not
> > under /data/config/container/)
> >
> > Could you please let me know if i need to mention anything in the git
> > module...thanks for the help..
>
> That's just how Git and the Git module work.
>
> As the Ansible documentation for Git module state:
> dest -> The path of where the repository should be checked out.
>
> Ansible is running
> git clone http://pathtothegit/container.git /data/config
>
> If you do that on the command line you'll get the same result.
>
> From the man git:
> git clone <repository> [<directory>]
>
> <directory>
>   The name of a new directory to clone into. The "humanish" part of the
>   source repository is used if no directory is explicitly given
>   (repo for /path/to/repo.git and foo for host.xz:foo/.git). Cloning into
>   an existing directory is only allowed if the directory is empty.
>
> --
> Kai Stian Olstad
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/pWbmvUE4s3o/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/32205571.nV2FNgakgq%40x1.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CALguqPK8BhQZSoTG4n3MT96S339raYz%3Dc_4zU1eDCJT5ca7S9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to