Created
May 19, 2014 14:59
-
-
Save vicendominguez/2c2fde50270c0eb89427 to your computer and use it in GitHub Desktop.
Ansible:plauing with pub 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
#this is a part of the original playbook: | |
- name: Creating pub SSH keys | |
command: ssh-keygen -N '' -f /root/.ssh/id_rsa | |
- name: Downloading pub key | |
fetch: src=/root/.ssh/id_rsa.pub dest=/tmp/id_rsa.tmp flat=yes | |
- name: Coping local key to other.server.net | |
local_action: shell cat /tmp/id_rsa.tmp | ssh -p 2244 root@other.server.net "cat >> /root/.ssh/authorized_keys" | |
- name: Deleting temporal files | |
local_action: command rm -f /tmp/id_rsa.tmp | |
- name: Syncing configuration files from other.server.net | |
shell: rsync -avHz --rsh='ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p2244' root@other-server.net:/opt/conf/* /opt/conf/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment