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

Commit 3d351ef

Browse files
author
Sebastian Gumprich
committed
Merge branch 'PovilasGT-master'
2 parents 78fc2be + afe9557 commit 3d351ef

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tasks/hardening.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
- name: Set OS dependent variables
33
include_vars: '{{ item }}'
44
with_first_found:
5-
- '{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml'
6-
- '{{ ansible_distribution }}.yml'
7-
- '{{ ansible_os_family }}_{{ ansible_distribution_major_version }}.yml'
8-
- '{{ ansible_os_family }}.yml'
5+
- '{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml'
6+
- '{{ ansible_facts.distribution }}.yml'
7+
- '{{ ansible_facts.os_family }}_{{ ansible_facts.distribution_major_version }}.yml'
8+
- '{{ ansible_facts.os_family }}.yml'
99

1010
- name: get openssh-version
1111
command: ssh -V

templates/opensshd.conf.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ LogLevel {{ sshd_log_level }}
8787
UseLogin no
8888
{% endif %}
8989
{% if sshd_version is version('7.5', '<') %}
90-
UsePrivilegeSeparation {% if (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6') or (ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6') -%}{{ssh_ps53}}{% else %}{{ssh_ps59}}{% endif %}
90+
UsePrivilegeSeparation {% if (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version <= '6') or (ansible_facts.os_family in ['Oracle Linux', 'RedHat'] and ansible_facts.distribution_major_version <= '6') -%}{{ssh_ps53}}{% else %}{{ssh_ps59}}{% endif %}
9191
{% endif %}
9292

9393
LoginGraceTime 30s
@@ -217,13 +217,13 @@ UseDNS {{ 'yes' if (ssh_use_dns|bool) else 'no' }}
217217

218218
PrintMotd {{ 'yes' if (ssh_print_motd|bool) else 'no' }}
219219

220-
{% if ansible_os_family != 'FreeBSD' %}
220+
{% if ansible_facts.os_family != 'FreeBSD' %}
221221
PrintLastLog {{ 'yes' if (ssh_print_last_log|bool) else 'no' }}
222222
{% endif %}
223223

224224
Banner {{ '/etc/ssh/banner.txt' if (ssh_banner|bool) else 'none' }}
225225

226-
{% if ansible_os_family == 'Debian' -%}
226+
{% if ansible_facts.os_family == 'Debian' -%}
227227
DebianBanner {{ 'yes' if (ssh_print_debian_banner|bool) else 'no' }}
228228
{% endif %}
229229

tests/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- file: path="/var/run/sshd" state=directory
1818
- name: create ssh host keys
1919
command: "ssh-keygen -A"
20-
when: not ((ansible_os_family in ['Oracle Linux', 'RedHat']) and ansible_distribution_major_version < '7') or ansible_distribution == "Fedora"
20+
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or ansible_facts.distribution == "Fedora"
2121

2222
roles:
2323
- ansible-ssh-hardening

tests/default_custom.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
- file: path="/var/run/sshd" state=directory
1818
- name: create ssh host keys
1919
command: "ssh-keygen -A"
20-
when: not ((ansible_os_family in ['Oracle Linux', 'RedHat']) and ansible_distribution_major_version < '7') or ansible_distribution == "Fedora"
20+
when: not ((ansible_facts.os_family in ['Oracle Linux', 'RedHat']) and ansible_facts.distribution_major_version < '7') or ansible_facts.distribution == "Fedora"
2121

2222
roles:
2323
- ansible-ssh-hardening

0 commit comments

Comments
 (0)