aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/space_server/tasks/sshd.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/roles/space_server/tasks/sshd.yml b/roles/space_server/tasks/sshd.yml
index aaf6452..63f3367 100644
--- a/roles/space_server/tasks/sshd.yml
+++ b/roles/space_server/tasks/sshd.yml
@@ -6,6 +6,30 @@
tags:
- packages
+- name: Create private host keys
+ copy:
+ dest: '/etc/ssh/{{ item.key }}'
+ content: '{{ item.value.private }}'
+ owner: root
+ group: ssh_keys
+ mode: 0640
+ with_dict: '{{ ssh_host_keys }}'
+ loop_control:
+ label: '/etc/ssh/{{ item.key }}'
+ when: ssh_host_keys is defined
+
+- name: Create public host keys
+ copy:
+ dest: '/etc/ssh/{{ item.key }}.pub'
+ content: '{{ item.value.public }}'
+ owner: root
+ group: root
+ mode: 0644
+ with_dict: '{{ ssh_host_keys }}'
+ loop_control:
+ label: '/etc/ssh/{{ item.key }}.pub'
+ when: ssh_host_keys is defined
+
- name: Configure sshd
lineinfile:
path: '/etc/ssh/sshd_config'