The Ops Community ⚙️

Alese Michael
Alese Michael

Posted on

Using ansible to git pull

Hello good day everyone. :)
Yes I have a question relating a server I want to update.
I created a server using cloudformation, configured the server and deployed an application on the server successfully using ansible. However because the developer isn't yet done with writing the code, I'd like to know how to use ansible to git pull the code into the server so there can be like a continuous deployment. As I do not want to keep creating a new server and changing the IP. Thanks.

Top comments (3)

Collapse
 
patrick_londa profile image
Patrick Londa

hey @kingsathurthi @jmarhee, I know you both have written about different Ansible use cases before. Do you have any suggestions here for @nvsblmike?

Collapse
 
jmarhee profile image
Joseph D. Marhee

Ansible has a git built-in module that seems like it might be what you're looking for (it'll track a branch, will default to checking out at HEAD, which sounds like what you want if the work is ongoing on a development branch, rather than a tagged release or something) if you run the playbook on some kind of rolling basis.

Collapse
 
kingsathurthi profile image
kingsathurthi

Yeah as @jmarhee said you can use Ansible git module to achieve this use case