2017-01-27 2 views
0

나는 가능성있는 플레이 북에서 git clone 명령을 실행하려고합니다.가능 : git 모듈을 사용할 때 "Permission denied (publickey)"가 발생했습니다.

- name: a play that runs entirely on the ansible host 
    hosts: 127.0.0.1 
    connection: local 
    tasks: 
    - name: check out a git repository 
    git: repo={{ repo_url }} dest=/Dest/For/Cloning/ accept_hostkey=yes 
    vars: 
     repo_url: [email protected]:lorin/mezzanine-example.git 

을 그리고, 내 CFG 파일은 다음과 같습니다 : 그것은 다음과 같습니다

[defaults] 
transport = ssh 

[ssh_connection] 
ssh_args= -A 

을하지만, 내가 명령을 실행 해요 때 ansible-playbook -i "localhost," -c local GitClone.yaml을, 나는 Permission denied (publickey) 오류가 발생합니다.

내 로컬 [지정한 파일 경로]에 gh repo를 복제하고 싶습니다.

+0

'ssh -T git @ github.com'의 결과는 무엇입니까? GitHub 계정이 있습니까? – techraf

+0

'Permission denied (publickey) .' – Dawny33

+1

설정해야합니다. http://stackoverflow.com/questions/2643502/git-permission-denied-publickey :) – Dawny33

답변

1

다른 사람의 공개 repo를 복제하고 GitHub로 다시 푸시하지 않으려 고하는 것처럼 보입니다. 당신은 당신이 transport 설정을 무시 호출 ansible-playbook-c local를 사용하는 경우 : 보조 노트로

repo_url: https://github.com/lorin/mezzanine-example.git 

: 당신은 그래서 그냥 사용, 그것을위한 GitHub의 자격 증명을 제공하기 위해 HTTPS 전송을 필요가 없습니다

ansible.cfg에서 예제 파일의 설정은 무시됩니다.

+0

고마워요. :). 그것은 효과가 있었다. 내 레포를 위해 어떻게해야합니까? 나는 계속해서 밀어 붙일 것이다. – Dawny33