【发布时间】:2017-09-11 11:33:22
【问题描述】:
虽然看起来很简单,但我的 ansible 设置在尝试克隆具有子模块的 git 存储库时会挂起。 'parent' repo 被克隆没有问题,但是 ansible 任务无法克隆子模块并且实际上在此之后挂起,几乎就像它期待一些响应一样......
这是我克隆 repo 的 ansible 任务:
- name: Clone/Pull the {{ certificate_authority.repo.name }} repository
become: yes
git: repo="{{ ca.repo.url }}" force=yes accept_hostkey=yes clone=yes version="{{ git_branch | default(git_tag) }}"
dest="{{ ca.repo.dest }}" key_file={{ ca.repo.key.location }}/{{ ca.repo.key.name }} recursive=yes track_submodules=yes
知道为什么 ansible 会挂起克隆这个 repo 吗?
【问题讨论】:
-
使用
-vvv运行您的剧本是否会产生任何有用的细节?如果您在挂起时运行ps,它正在运行的git命令行是什么?你能在同一系统上从命令行成功克隆它吗? -
Running with
-vvvv包括以下有趣的 sn-p...Looking up /var/folders/z9/v1czs6dd7vb5jtq_0fr8f5y80000gp/T/tmp_lrYWR\r\ndebug3: Sent message fd 8 T:17 I:2\r\ndebug3: Received stat reply T:101 I:2\r\ndebug1: Couldn\'t stat remote file: No such file or directory\r\ndebug3: Sent message SSH2_FXP_OPEN I:3 ... SSH2_FXP_STATUS 0\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')。运行ps aux|grep git显示以下正在运行` -
并运行
ps aux | grep git显示正在运行的命令是/usr/bin/python /tmp/ansible_6X_csE/ansible_module_git.py、/usr/bin/git submodule update --init --recursive --force、/bin/sh /usr/lib/git-core/git-submodule update --init --recursive --force(对于 3 个子模块中的每一个)、git submodule--helper update-clone和/usr/lib/git-core/git submodule--helper clone --path lib/first-subproject --name lib/first-subproject --url https://reayn@bitbucket.org/reayn/first-subproject.git。所以看起来 ansible 正在尝试克隆 repos