Created
October 16, 2014 09:31
-
-
Save feiz/f216762d7741ed5b4c9a to your computer and use it in GitHub Desktop.
リモートでssh-keygenして別のホストにpubkeyを設定する
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
- hosts: foo | |
tasks: | |
- command: ssh-keygen ... | |
- fetch: | |
src: ~/.ssh/id_rsa.pub | |
dest: _pubkey | |
- hosts: bar | |
tasks: | |
- authorized_key: | |
key: "{{ lookup('file', '_pubkey') }}" | |
user: www | |
- hosts: 127.0.0.1 | |
connection: local | |
tasks: | |
- command: rm _pubkey |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment