How create new Git repository from Ansible directly?

34 views
Skip to first unread message

SwApNiL PATIL

unread,
Jan 13, 2017, 1:28:33 PM1/13/17
to Ansible Project
Hello All , 

I am only able to clone the repository from Git with the help of Git module of Ansible. I am able to create new repository from shell and attach that shell script to Ansible. 
But I want to know can I create new repository in Git from ansible directly with the help of Git module of Ansible ?

Your help is much appreciated. 

Thanks,
Swapnil Patil.

Igor Khomyakov

unread,
Jan 13, 2017, 2:02:34 PM1/13/17
to ansible...@googlegroups.com
Hi,

You simply can't. Git module is supposed to be used to manage git
**checkouts** of repositories.
However command module can be useful for you

- command: git init {{ repository }}

--
Best, Igor
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/8e7df72a-2a0c-47d3-903e-5002c210cc3c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Kai Stian Olstad

unread,
Jan 13, 2017, 2:06:17 PM1/13/17
to ansible...@googlegroups.com
On 13. jan. 2017 13:08, SwApNiL PATIL wrote:
> Hello All ,
>
> I am only able to clone the repository from Git with the help of Git module
> of Ansible. I am able to create new repository from shell and attach that
> shell script to Ansible.
> *But I want to know can I create new repository in Git from ansible
> directly with the help of Git module of Ansible ?*

Probably not as the documentation says
"Manage `git' checkouts of repositories to deploy files or software."


> Your help is much appreciated.

But you could use the command module to achieve this.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages