# git module question

**URL:** <https://forum.ansible.com/t/git-module-question/31897>\
**Category:** Ansible Project\
**Created:** [January 3, 2020, 7:36pm UTC](https://forum.ansible.com/t/git-module-question/31897 "2020-01-03T19:36:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mauricio\_Tavares](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@Mauricio\_Tavares](https://forum.ansible.com/u/Mauricio_Tavares)\
**Post date:** [January 3, 2020, 7:36pm UTC](https://forum.ansible.com/t/git-module-question/31897/1 "2020-01-03T19:36:03Z")

</div>

What is the equivalent of [1]

git submodule update --init

using the git [2] module? Would "update: yes" (the default) as in

- git:  
&nbsp;&nbsp;&nbsp;&nbsp;repo: '[https://foosball.example.org/path/to/repo.git](https://foosball.example.org/path/to/repo.git)’  
&nbsp;&nbsp;&nbsp;&nbsp;dest: /srv/checkout  
&nbsp;&nbsp;&nbsp;&nbsp;update: yes

suffice?

[1] [https://git-scm.com/docs/git-submodule](https://git-scm.com/docs/git-submodule)  
[2] [https://docs.ansible.com/ansible/latest/modules/git\_module.html](https://docs.ansible.com/ansible/latest/modules/git_module.html)

---

<div class="post-metadata">

**Author:** ![f.floimair.commend](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@f.floimair.commend](https://forum.ansible.com/u/f.floimair.commend)\
**Post date:** [January 7, 2020, 3:31pm UTC](https://forum.ansible.com/t/git-module-question/31897/2 "2020-01-07T15:31:59Z")

</div>

Sounds reasonable to me. The important part for submodules is the “recursive” parameter which is by default set to yes.  
Whether the git module implicitly uses --init on the first run I have never actually tried.
