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

Commit 3290ff2

Browse files
author
Sebastian Gumprich
committed
fix order
1 parent 8817e28 commit 3290ff2

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

tasks/main.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,20 @@
1212
changed_when: false
1313
register: sshd_version
1414

15-
- debug: var={{sshd_version.stdout}}
15+
- name: set hostkeys according to openssh-version
16+
set_fact:
17+
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key']
18+
when: sshd_version.stdout >= '5.3'
19+
20+
- name: set hostkeys according to openssh-version
21+
set_fact:
22+
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key']
23+
when: sshd_version.stdout >= '6.0'
24+
25+
- name: set hostkeys according to openssh-version
26+
set_fact:
27+
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']
28+
when: sshd_version.stdout >= '6.3'
1629

1730
- name: create sshd_config and set permissions to root/600
1831
template: src='opensshd.conf.j2' dest='/etc/ssh/sshd_config' mode=0600 owner=root group=root validate="/usr/sbin/sshd -T -f %s"
@@ -46,21 +59,6 @@
4659
changed_when: false
4760
check_mode: no
4861

49-
- name: set hostkeys according to openssh-version
50-
set_fact:
51-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key']
52-
when: sshd_version.stdout >= '5.3'
53-
54-
- name: set hostkeys according to openssh-version
55-
set_fact:
56-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key']
57-
when: sshd_version.stdout >= '6.0'
58-
59-
- name: set hostkeys according to openssh-version
60-
set_fact:
61-
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_ecdsa_key', '/etc/ssh/ssh_host_ed25519_key']
62-
when: sshd_version.stdout >= '6.3'
63-
6462
- block: # only runs when selinux is running
6563
- name: install selinux dependencies when selinux is installed on RHEL or Oracle Linux
6664
yum: name="{{item}}" state=installed

0 commit comments

Comments
 (0)