Skip to content

Commit

Permalink
works for me state acompished
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Wendel committed Aug 30, 2015
1 parent 81cb795 commit a833bee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/generate_serverkeys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ find "$servers" -type f -print0 | while read -d '' -r serverentry; do
itemcontent=$(cat "$tmp/$item")
printf -v keycontent "%s \\\n %s" "$keycontent" "$itemcontent"
done < "$serverentry"
printf " - { user: '%s', key: \"%s\"}\n" "$username" "$keycontent" >> "$vardir/maesto_$servername"
printf " - { user: '%s',\n key: \"%s\"}\n" "$username" "$keycontent" >> "$vardir/maesto_$servername"


done
Expand Down
8 changes: 6 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
- name: loading vars for host
include_vars: "maesto_{{ansible_hostname }}"

#- debug: var="{{ item }}"
# with_items: "{{ maesto_ssh_keys }}"


- name: adding user before adding key
user: name="{{ item.user }}"
with_dict: maesto_ssh_keys
with_items: "{{ maesto_ssh_keys }}"

- name: addin ssh keys for host
authorized_key: exclusive=yes user="{{ item.user }}" key="{{ item.key }}"
with_dict: maesto_ssh_keys
with_items: "{{ maesto_ssh_keys }}"

0 comments on commit a833bee

Please sign in to comment.