Created
March 1, 2014 02:23
-
-
Save shohey1226/9283994 to your computer and use it in GitHub Desktop.
Ansible playbook add user using public ssh key on Github
This file contains hidden or 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: add user and create ssh key | |
user: name=shohei | |
- name: dowanload pubkey from Github and placed as authorized_keys | |
get_url: url=https://github.com/shohey1226.keys dest=/tmp/shohei.authorized_keys | |
delegate_to: 127.0.0.1 | |
- name: Create authorized_keys from the file that just downloaded | |
authorized_key: user=shohei key="{{ lookup('file', '/tmp/shohei.authorized_keys') }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This seems cleaner.