2017-01-10 43 views
0

我想從兩個使用Ansible我的Git回購的拉動,但我似乎得到這個錯誤:錯誤 - {無法找到所需的可執行的git}

failed: [app01] (item={u'dest': u'/etc/', u'repo': u'Vigorate'}) =>{"failed": true, "item": {"dest": "/etc/", "repo": "Vigorate"}, "msg": "Failed to find required executable git"} 
failed: [app01] (item={u'dest': u'/etc/', u'repo': u'Paint-UI'}) => {"failed": true, "item": {"dest": "/etc/", "repo": "Paint-UI"}, "msg": "Failed to find required executable git"} 

我的混帳.yml劇本是這樣的:

編輯:

- hosts: app01 
vars: 
- destination: /home/vagrant/rep 
tasks: 

- name: Install dependencies 
    apt: name={{ item }} state=present 
    with_items: 
    - htop 
    - git-all 

- name: Pull from Git 
    git: repo=http://[email protected]/*****/{{ item.repo }}.git 
     dest={{ item.dest }} 
     # accept_hostkey=yes 
     # force=yes 
     # recursive=no 
    with_items: 
    - 
     dest: "{{ destination }}" 
     repo: RepoEexample 
    # - 
    # dest: "{{ destination }}" 
    # repo: RepoExample 

任何幫助,將不勝感激

回答

2

我相信這個錯誤表明,在您的ansible劇本的git:是無法識別的,不存在的。你想確保你在使用之前已經安裝了git。喜歡的東西:

- name: Install dependencies 
    yum: name={{ item }} state=present 
    with_items: 
    - htop 
    - git-all 
    - python-devel 

將安裝HTOP,git的,和Python這樣,那麼你運行你git節。

如果你安裝了Git的肯定,那麼接下來可能出現的錯誤可能是你with_items部分的語法。嘗試將其分成兩個代碼不同節(乏味,是)只是爲了確保它的工作原理,如果是的話,它是當前版本的格式,而不是一個git的問題。

---------- UPDATE

確保下面的作品,然後專注於具有代碼的單節克隆多個回購。

- name: Pull from Git 
    git: [email protected]/daniyalj/Vigorate.git 
     dest=/path/to/destination 
+0

好了就解決了! 但現在我似乎得到錯誤「致命的:庫‘[email protected]/daniyalj/Vigorate.git’不存在\ n」個 感謝您的幫助@笑馬 – firebolt

+0

精彩! 你將要在那裏仔細檢查git-URL。確保你有正確的(不管是http還是ssh)。同樣,我建議寫代碼,而不變量,以確保你得到看中之前已經明確了語法,然後拋回那些在 –

+0

小的http://解決的伎倆!感謝@笑馬 – firebolt

相關問題