Ansible playbook访问Git回购

Ansible playbook访问Git回购,git,ansible,Git,Ansible,我有一个剧本,如下所示: --- - hosts: 172.xx.xx.xx remote_user: ec2-user become: yes become_method: sudo tasks: - git: repo: https://github.com/mygitrepo/falconow.git dest: /var/www/html version: release-0.1 fatal: [172.xx.xx.xx]: FAILED! => {"changed":

我有一个剧本,如下所示:

---
- hosts: 172.xx.xx.xx
remote_user: ec2-user
become: yes
become_method: sudo
tasks:
- git:
repo: https://github.com/mygitrepo/falconow.git
dest: /var/www/html
version: release-0.1
    fatal: [172.xx.xx.xx]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to find required executable git"}
 [WARNING]: Could not create retry file
'/var/lib/jenkins/workspace/Ansible/copy.retry'.         [Errno 13] Permission
denied: u'/var/lib/jenkins/workspace/Ansible/copy.retry'
当我尝试运行此playbook时,出现如下所示的错误:

---
- hosts: 172.xx.xx.xx
remote_user: ec2-user
become: yes
become_method: sudo
tasks:
- git:
repo: https://github.com/mygitrepo/falconow.git
dest: /var/www/html
version: release-0.1
    fatal: [172.xx.xx.xx]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to find required executable git"}
 [WARNING]: Could not create retry file
'/var/lib/jenkins/workspace/Ansible/copy.retry'.         [Errno 13] Permission
denied: u'/var/lib/jenkins/workspace/Ansible/copy.retry'
我确信这类回购协议或文件的存在。有人能给我指出正确的方向吗。

从评论中回答:


我认为一个好主意是在服务器
172.xx.xx.xx
上安装
git


Ansible在远程服务器上执行任务。因此,是的,模块的所有要求都必须安装在远程服务器上


Ansible已经为您指明了正确的方向:
未能找到所需的可执行git
。he he。。我明白。。但这意味着什么?我在谷歌上搜索并尝试了一些结果,但没有成功。我认为一个好主意是在服务器上安装
git
172.xx.xx
…在服务器172上。。?这个服务器是一个节点,基本上是一个模拟web服务器的节点,在这里我尝试从git获取文件并将其放在目录中。在这种情况下,我们是否需要在使用本playbook访问的所有机器上安装git。。?或者你的意思是说在Ansible服务器上安装git?Ansible在远程服务器上执行任务。因此,是的,模块的所有要求都必须安装在远程服务器上。