代码之家  ›  专栏  ›  技术社区  ›  proximacentauri

Ansible Git克隆超时

  •  1
  • proximacentauri  · 技术社区  · 6 年前

    在服务器上,我可以成功运行以下内容:

    ssh-agent bash -c 'ssh-add /path/key; git clone https://repo_path/repo_name.git'
    

    回购被克隆到“回购名称”中。

    但是,当我在本地计算机上运行以下Ansible(2.2)脚本时,克隆任务无限期暂停。

    - name: clone or pull latest web app code
      git: repo=https://repo_path/repo_name.git dest=/home/user/repo_name
         key_file=/path/key
         accept_hostkey=yes
         force=yes
    

    克隆之前的其他任务taks工作正常(apt更新、库安装等)

    我正在使用以下方法检查路径是否正确,并且它们似乎正常:

    - debug:
        msg: "about to clone code {{ code_repository }} to {{ base_dir }}"
    

    有什么想法吗?

    1 回复  |  直到 6 年前
        1
  •  4
  •   VonC    6 年前

    ssh-add /path/key git clone https://repo_path/repo_name.git

    https://repo_path/...

    ansible git module

    accept_hostkey
    

    -o StrictHostKeyChecking=no

    key-file accept_hostkey