Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ruanbekker authored Jun 14, 2018
1 parent 8908471 commit ec27dfd
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions roles/configure-admin/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- name: Generate SSH keys
shell: ssh-keygen -b 2048 -f /home/docker/.ssh/id_rsa -t rsa -q -N ""
args:
creates: /home/docker/.ssh/id_rsa
- name: Copy Public Key Locally
fetch:
src: /home/docker/.ssh/id_rsa.pub
dest: /tmp/
flat: yes
- name: Copy SSH Configuration
copy:
src: ssh_config
dest: /home/docker/.ssh/config
mode: 0644
- name: empty known_hosts
file:
state: absent
path: ~/.ssh/known_hosts
- name: run ssh-keyscan to add keys to known_hosts
shell: "ssh-keyscan {{ item }} >> ~/.ssh/known_hosts"
with_items:
- "swarm-manager"
- "swarm-worker-1"
- "swarm-worker-2"

0 comments on commit ec27dfd

Please sign in to comment.