From 4df95e3733cfc871d5f1162c9b6ed08042376aec Mon Sep 17 00:00:00 2001 From: Dennis Eriksen <796800+dennisse@users.noreply.github.com> Date: Fri, 4 Nov 2022 11:00:55 +0000 Subject: [PATCH] OpenBSD does not set distributiuon_major_version (#597) This role fails with `The task includes an option with an undefined variable` on OpenBSD because `distributiuon_major_version` is not set on OpenBSD. We should either default to "" if the variable is not set, or remove `vars/OpenBSD.yml`. I would prefer the former :) Signed-off-by: Dennis Eriksen Signed-off-by: Dennis Eriksen --- roles/ssh_hardening/tasks/hardening.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ssh_hardening/tasks/hardening.yml b/roles/ssh_hardening/tasks/hardening.yml index 29aaa746..75164698 100644 --- a/roles/ssh_hardening/tasks/hardening.yml +++ b/roles/ssh_hardening/tasks/hardening.yml @@ -5,9 +5,9 @@ name: 'os_vars' with_first_found: - files: - - '{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version }}.yml' + - '{{ ansible_facts.distribution }}_{{ ansible_facts.distribution_major_version | default() }}.yml' - '{{ ansible_facts.distribution }}.yml' - - '{{ ansible_facts.os_family }}_{{ ansible_facts.distribution_major_version }}.yml' + - '{{ ansible_facts.os_family }}_{{ ansible_facts.distribution_major_version | default() }}.yml' - '{{ ansible_facts.os_family }}.yml' skip: true tags: always