Move ssh to role

This commit is contained in:
pgrondek 2020-05-25 23:22:23 +02:00
parent 585e71c2a4
commit 90379a77b5
6 changed files with 21 additions and 9 deletions

4
main.yml Normal file
View File

@ -0,0 +1,4 @@
---
- hosts: server
roles:
- ssh

View File

@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDwTqV2idle6AQj179tAuAxZzodtTb2aMJKIEnL+tXfdsKsoc8kfQV3JMtq53hk6jRcH/9+FamCBqP/2s1xT4elKAZ7GWYBMi4HqGr8Qr7I1sK2m9dydrmW+iepmhGNDdKlYkEFc8aM9blbCTEN9RqqJiSomzDAIZQWiV2E/18MIxu3WYKJ561uzILkmB9o7UJbdAgOGbk6+GkBIwGCX5CwlX4Ro8wLv/i55/bg03N1lAbsCeDqaZX7ikiy2hnxAFH/EuY2g2WK4x9yUjhUe1MnCZy5SealSP76b9BHyJVYrxGVyAZOtlnewEXzbJXnyHGQg00hXeT8YtTlMSXaQVih pgrondek@farnsworth

View File

@ -0,0 +1,7 @@
---
- name: install ssh
become: yes
apt:
update_cache: yes
pkg:
- openssh-server

5
roles/ssh/tasks/keys.yml Normal file
View File

@ -0,0 +1,5 @@
---
- name: copy authorized_keys
copy:
src: authorized_keys
dest: ${HOME}/.ssh/authorized_keys

4
roles/ssh/tasks/main.yml Normal file
View File

@ -0,0 +1,4 @@
---
- import_tasks: install.yml
- import_tasks: keys.yml

View File

@ -1,9 +0,0 @@
---
- name: copy ssh keys
hosts: server
tasks:
- name: copy authorized_keys
copy:
src: authorized_keys
dest: ${HOME}/.ssh/authorized_keys