aboutsummaryrefslogtreecommitdiffstats
path: root/roles/debian
diff options
context:
space:
mode:
Diffstat (limited to 'roles/debian')
-rw-r--r--roles/debian/tasks/sshd.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/roles/debian/tasks/sshd.yml b/roles/debian/tasks/sshd.yml
index 4c257fe..c342604 100644
--- a/roles/debian/tasks/sshd.yml
+++ b/roles/debian/tasks/sshd.yml
@@ -6,10 +6,10 @@
owner: root
group: ssh_keys
mode: 0640
- with_dict: '{{ ssh_host_keys }}'
+ with_dict: '{{ ssh_host_keys[hostname] }}'
loop_control:
label: '/etc/ssh/{{ item.key }}'
- when: ssh_host_keys is defined
+ when: ssh_host_keys is defined and hostname in ssh_host_keys
- name: Create public host keys
copy:
@@ -18,10 +18,10 @@
owner: root
group: root
mode: 0644
- with_dict: '{{ ssh_host_keys }}'
+ with_dict: '{{ ssh_host_keys[hostname] }}'
loop_control:
label: '/etc/ssh/{{ item.key }}.pub'
- when: ssh_host_keys is defined
+ when: ssh_host_keys is defined and hostname in ssh_host_keys
- name: Configure SSH daemon
lineinfile: