Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git-Ansible克隆问题_Git_Ansible - Fatal编程技术网

Git-Ansible克隆问题

Git-Ansible克隆问题,git,ansible,Git,Ansible,我有一个git回购协议,下面是我的ansible git代码 --- - name: read-write git checkout from repo git: repo: "{{repo_url}}" dest: "{{webapps_dir}}/{{app_name}}" accept_hostkey: yes force: yes remote: "{{repo_remote}}" version: "{{repo_branch}}

我有一个git回购协议,下面是我的ansible git代码

---
 - name: read-write git checkout from repo
   git:
    repo: "{{repo_url}}"
    dest: "{{webapps_dir}}/{{app_name}}"
    accept_hostkey: yes
    force: yes
    remote: "{{repo_remote}}"
    version: "{{repo_branch}}"
   register: gitrepo
当我运行上述任务时,它会挂断/无休止地等待。我尝试过调试,发现当我将git主机添加到已知主机(手动进入服务器,然后加载),然后运行这个playbook时,效果很好

虽然我已将
accept_hostkey
设置为
yes
,但它仍然挂起或无休止地等待

如何使用上述剧本克隆git回购

---
- hosts: all
  gather_facts: no
  become: yes
  vars_prompt:
    - name: "gituser"
      prompt: "Enter your gitlab ID or username ex: user@XXXX.XXX"
      private: no
    - name: "gitpassword"
      prompt: "Enter your gitlab password"
      private: yes

  tasks:
    - name: Cloning from git 
      git:
        repo: "https://{{ gituser | urlencode }}:{{ gitpassword | urlencode }}@git###.####.###/group/projects.git"
        dest: /usr/share/clonefolder
        clone: yes
        update: yes
        force: yes
这可能对你有帮助。接受主机密钥,我正在处理它。我会在完成后更新你


谢谢

你试过打开详细模式吗?我试过了。它仍然挂起或无休止地等待。它的O/P是什么?没什么..它只是让…你的机器或网络上有防火墙吗?使用ssl时出现问题?