Skip to content

Commit

Permalink
add var ssh_host_keys_dir, for OSes with alternate host key locations
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Waite <[email protected]>
  • Loading branch information
aqw committed Jul 28, 2020
1 parent 325a607 commit 855f8a9
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tasks/crypto_hostkeys.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
---
- name: set hostkeys according to openssh-version if openssh >= 5.3
set_fact:
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key']
ssh_host_key_files:
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
when: sshd_version is version('5.3', '>=')

- name: set hostkeys according to openssh-version if openssh >= 6.0
set_fact:
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key']
ssh_host_key_files:
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
when: sshd_version is version('6.0', '>=')

- name: set hostkeys according to openssh-version if openssh >= 6.3
set_fact:
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']
ssh_host_key_files:
- "{{ ssh_host_keys_dir }}/ssh_host_rsa_key"
- "{{ ssh_host_keys_dir }}/ssh_host_ecdsa_key"
- "{{ ssh_host_keys_dir }}/ssh_host_ed25519_key"
when: sshd_version is version('6.3', '>=')
1 change: 1 addition & 0 deletions vars/Archlinux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
1 change: 1 addition & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: ssh
ssh_owner: root
ssh_group: root
Expand Down
1 change: 1 addition & 0 deletions vars/Fedora.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
1 change: 1 addition & 0 deletions vars/FreeBSD.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: wheel
1 change: 1 addition & 0 deletions vars/OpenBSD.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: wheel
Expand Down
1 change: 1 addition & 0 deletions vars/Oracle Linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
1 change: 1 addition & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
1 change: 1 addition & 0 deletions vars/RedHat_8.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/sbin/sshd
ssh_host_keys_dir: '/etc/ssh'
sshd_service_name: sshd
ssh_owner: root
ssh_group: root
Expand Down
1 change: 1 addition & 0 deletions vars/SmartOS.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sshd_path: /usr/lib/ssh/sshd
ssh_host_keys_dir: '/var/ssh'
sshd_service_name: ssh
ssh_owner: root
ssh_group: root
Expand Down

0 comments on commit 855f8a9

Please sign in to comment.