Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

Commit 4bb909d

Browse files
committed
add var ssh_host_keys_dir, for OSes with alternate host key locations
Signed-off-by: Alex Waite <alex@waite.eu>
1 parent 84cc821 commit 4bb909d

File tree

10 files changed

+18
-3
lines changed

10 files changed

+18
-3
lines changed

tasks/crypto.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
---
22
- name: set hostkeys according to openssh-version
33
set_fact:
4-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']
4+
ssh_host_key_files:
5+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
6+
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
7+
- "{{ ssh_host_keys_dir }}/ssh_host_ed25519_key"
58
when: sshd_version is version('6.3', '>=') and not ssh_host_key_files
69

710
- name: set hostkeys according to openssh-version
811
set_fact:
9-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key']
12+
ssh_host_key_files:
13+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
14+
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
1015
when: sshd_version is version('6.0', '>=') and not ssh_host_key_files
1116

1217
- name: set hostkeys according to openssh-version
1318
set_fact:
14-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key']
19+
ssh_host_key_files:
20+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
1521
when: sshd_version is version('5.3', '>=') and not ssh_host_key_files
1622

1723
###

vars/Archlinux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: sshd
34
ssh_owner: root
45
ssh_group: root

vars/Debian.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: ssh
34
ssh_owner: root
45
ssh_group: root

vars/Fedora.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: sshd
34
ssh_owner: root
45
ssh_group: root

vars/FreeBSD.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: sshd
34
ssh_owner: root
45
ssh_group: wheel

vars/OpenBSD.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: sshd
34
ssh_owner: root
45
ssh_group: wheel

vars/Oracle Linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: sshd
34
ssh_owner: root
45
ssh_group: root

vars/RedHat.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: sshd
34
ssh_owner: root
45
ssh_group: root

vars/RedHat_8.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/sbin/sshd
2+
ssh_host_keys_dir: '/etc/ssh'
23
sshd_service_name: sshd
34
ssh_owner: root
45
ssh_group: root

vars/SmartOS.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sshd_path: /usr/lib/ssh/sshd
2+
ssh_host_keys_dir: '/var/ssh'
23
sshd_service_name: ssh
34
ssh_owner: root
45
ssh_group: root

0 commit comments

Comments
 (0)