Skip to content

Commit

Permalink
add ssh keys to a cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
grierdavid committed May 20, 2016
1 parent 439034f commit 2abc634
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions add_keys.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

export RAX_CREDS_FILE=$(grep rax_credentials_file playbooks/group_vars/all|cut -d"'" -f2)
export RAX_REGION=$(grep rax_region playbooks/group_vars/all|cut -d"'" -f2)

ansible-playbook -vvv -i inventory/rax.py playbooks/add_keys.yml
13 changes: 13 additions & 0 deletions playbooks/add_keys.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- include: create_groups.yml

- name: "add keys to the cluster"
hosts: hadoop-cluster
any_errors_fatal: true
become: yes
pre_tasks:
- name: "Show hadoop-cluster info"
debug: var="{{ hostvars[inventory_hostname] }}"
when: debug
tasks:
- name: "add key"
authorized_key: user=root key="{{ lookup('file', 'keys/nirmal-key') }}"
1 change: 1 addition & 0 deletions playbooks/keys/nirmal-key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDNB5VjYR2gxZltdehQRU9T7ReE+6LeZe6NB29UdJvZyCaAf0SXktVvxg0BOh1Lw0LEZ2RTEP+qM2EHHuAOAyQxXKv9yu+SJUKWACoX6aj9MnB3e2f6Aam6S3UrR+IG/A9W0BNB7SSZUWM/9x+Jl1DdOSTO8ljxR+fklXPfBMZVHQEFEBzF4Pf6GfI8AORfYPRYzPb8EmVAB56XrNTHouIKllthrzhGZwNU72o0wbjBdHMUSbKOLnOFfDJX4VdKueEokeFMnPa6tpNpLElF4yEQRpnprd+wyUEG4gd+0PKr+n3QrJCghjgQ2kphQZaDNi2Ij3DX5twE62lerq7Xhaff [email protected]

0 comments on commit 2abc634

Please sign in to comment.