2017-01-20 4 views
1

私は、anacible-galaxy(v2.0.0.2)を使用して、requirements.ymlファイルを通してBitbucket上にソースコードを持つ役割をインストールしています。しかし、bitbucket.orgのコードを秘密鍵でチェックアウトすることはできませんでした。ここにエラーメッセージと私のrequirements.ymlの内容があります。gitbucket.orgのanacle-galaxyとgit clone

いずれかが適切なrequirements.yml aniable-galaxy 2.0.0.2のファイル形式ですか?

+ ansible-galaxy -vvv install --force --role-file ansible/requirements.yml --roles-path ./ansible/roles 

    Using /etc/ansible/ansible.cfg as config file 
    Opened /tmp/.ansible_galaxy 
    found role {'scm': 'git', 'src': '[email protected]:myrepo/nginx.git', 'version': 'latest', 'name': 'nginx'} in yaml file 
    Installing role nginx 

    [WARNING]: - nginx was NOT installed successfully: - command git checkout 
    latest failed in directory /tmp/tmpQRZc8j (rc=1) 
    ERROR! - you can use --ignore-errors to skip failed roles and finish processing the list. 

[requirements.yml]

- name: nginx 
    src: [email protected]:myrepo/nginx.git 
    scm: git 
    version: latest 
    accept_hostkey: yes 
    key_file: /tmp/.ssh/id_rsa 

答えて

1

たぶん、scpコマンドの構文は動作しません。 1のかもしれURL:

ssh://[email protected]/myrepo/nginx.git 

てみてください、this ansible issueのように:

githubのクローンレポパスから

直接コピー

[email protected]:geerlingguy/ansible-role-php.git 

を作品

実際のURL

ssh://[email protected]/geerlingguy/ansible-role-php.git 

:/に置き換える必要があります。
URL(つまり、://を含む)が必要です。それ以外の場合は、銀河系はファイルシステムのパスとみなされます。

0

あなたが/tmp/tmpQRZc8jディレクトリを見ると、あなたの役割がフェッチされていることがわかります。

間違ったバージョンの引数を指定していて、誰かがgit checkout latestを作成しようとしていないという問題があります(最新のブランチまたはタグを使用していない限り)。

代わりに既存のブランチまたはタグを指定する必要があります。

関連する問題