【问题标题】:Ansible playbook to access Git repo访问 Git 存储库的 Ansible 剧本
【发布时间】:2017-04-20 10:50:53
【问题描述】:

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

---
- 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'

我确信其中存在此​​类 repo 或文件。请有人指出我正确的方向。

【问题讨论】:

  • Ansible 已经为您指明了正确的方向:Failed to find required executable git
  • 嘿嘿.. 我明白.. 但这是什么意思?我用谷歌搜索并尝试了一些结果,但没有工作。
  • 我认为一个好主意是在服务器172.xx.xx.xx上安装git...
  • 在服务器 172..?这个服务器是一个节点,基本上是一个网络服务器的模拟,我尝试从 git 中获取文件并将其放在目录中。在那种情况下,我们是否需要在我们使用这个剧本访问的所有机器上安装 git..?还是说要在 Ansible 服务器上安装 git?
  • Ansible 在远程服务器上执行任务。所以,是的,对模块的所有要求都必须安装在远程服务器上。

标签: git ansible


【解决方案1】:

评论回复:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-18
    • 1970-01-01
    • 1970-01-01
    • 2013-08-03
    • 2015-01-18
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    相关资源
    最近更新 更多