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

Commit 670be01

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 1a28c7b commit 670be01

File tree

10 files changed

+18
-3
lines changed

10 files changed

+18
-3
lines changed

tasks/crypto_hostkeys.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
---
22
- name: set hostkeys according to openssh-version if openssh >= 5.3
33
set_fact:
4-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key']
4+
ssh_host_key_files:
5+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
56
when: sshd_version is version('5.3', '>=')
67

78
- name: set hostkeys according to openssh-version if openssh >= 6.0
89
set_fact:
9-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key']
10+
ssh_host_key_files:
11+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
12+
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
1013
when: sshd_version is version('6.0', '>=')
1114

1215
- name: set hostkeys according to openssh-version if openssh >= 6.3
1316
set_fact:
14-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']
17+
ssh_host_key_files:
18+
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
19+
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
20+
- "{{ ssh_host_keys_dir }}/ssh_host_ed25519_key"
1521
when: sshd_version is version('6.3', '>=')

vars/Archlinux.yml

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

vars/Debian.yml

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

vars/Fedora.yml

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

vars/FreeBSD.yml

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

vars/OpenBSD.yml

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

vars/Oracle Linux.yml

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

vars/RedHat.yml

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

vars/RedHat_8.yml

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

vars/SmartOS.yml

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

0 commit comments

Comments
 (0)