Created
December 8, 2015 11:48
-
-
Save SebastienElet/92919a2faf7f0bf903b4 to your computer and use it in GitHub Desktop.
ansible install ssh keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: install ssh keys | |
copy: | |
content: "{{ item.value }}" | |
dest: /home/www/.ssh/{{ item.key }} | |
mode: 0600 | |
owner: www | |
with_dict: github_ssh_keys | |
no_log: True | |
- name: install ssh key | |
copy: | |
content: "{{ github_ssh_key }}" | |
dest: /home/www/.ssh/github_rsa | |
mode: 0600 | |
owner: www | |
with_dict: github_ssh_key | |
no_log: True | |
- name: clone repo | |
git: | |
repo=git@github.com:*****/*****.git | |
dest=/home/www/myrepo | |
accept_hostkey=true | |
key_file=/home/www/.ssh/github_rsa | |
sudo: yes | |
sudo_user: www | |
register: git_clone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
github_ssh_key: | | |
-----BEGIN RSA PRIVATE KEY----- | |
... | |
-----END RSA PRIVATE KEY----- | |
github_ssh_keys: | |
project1: | | |
-----BEGIN RSA PRIVATE KEY----- | |
... | |
-----END RSA PRIVATE KEY----- | |
frontend: | | |
-----BEGIN RSA PRIVATE KEY----- | |
... | |
-----END RSA PRIVATE KEY----- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The file
vars.yml
should be vaulted ofc