Ansible-Puppet-Chef
[ansible] key로 git clone하는 다운로드 예제
'김용환'
2019. 6. 18. 18:35
git 프로젝트를 다운받을 때 github key를 사용해 다운로드 한다.
앤서블을 사용하는 첫 번째 방법 - ~/.ssh/config 파일을 수정한다
Host github.com
IdentityFile ~/.ssh/github_rsa
- name: Download config
git:
repo: git@github.com:uj/config.git
dest: "{{program_path}}/config"
force: yes
clone: yes
앤서블을 사용하는 두 번째 방법 - 직접 key 파일을 가르키게 한다.
- name: Download thin-backup source
git:
repo: git@github.com:uj/config.git
dest: "{{program_path}}/config"
force: yes
clone: yes
accept_hostkey: yes
key_file: /home/www/.ssh/github_rsa