是否可以在没有 "command:" 的情况下执行 "git submodule update" 或使用 Ansible 执行 "shell:" ?

Is it possible to execute "git submodule update" without "command:" or "shell:" with Ansible?

所以我被赋予了通过 Ansible 更新某个目录的任务,但我似乎找不到用 git:.

执行 git submodule update 的方法

不使用command:shell:真的没有其他方法可以做到git submodule update吗?

我当前的代码:

# Command to execute: git remote update
- name: Git Update
  git:
    repo: "{{ git_ssh_key }}"
    dest:  ~/some/directory
    update: yes
    version: master

# Command to execute: git reset --hard origin/master
- name: Git reset
  command: git reset --hard origin/master
  args: 
    chdir: ~/some/directory

# Command to execute: git submodule update
- name: Git Submodule Update
  [Here is where I need your help to execute "git submodule update"]

非常感谢任何帮助。

添加参数recursive: yes:

# Command to execute: git submodule update
- name: Git Submodule Update
  git:
      repo: "{{ git_ssh_key }}"
      dest:  ~/some/directory
      recursive: yes
      update: yes
      version: master

请参阅 https://docs.ansible.com/ansible/latest/modules/git_module.html

中的文档