From 425400d521f947d62d9af8225c1b51551fcb8800 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Mon, 23 Nov 2020 15:24:52 +0100 Subject: [PATCH] Do not attempt to create and verify sysconfig on unrelated systems --- tasks/install.yml | 1 + tests/tests_sysconfig.yml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 397bd9b..e08508a 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -19,6 +19,7 @@ backup: "{{ sshd_backup }}" when: - sshd_sysconfig|bool + - __sshd_sysconfig_supports_use_strong_rng or __sshd_sysconfig_supports_crypto_policy notify: reload_sshd - name: Make sure hostkeys are available and have expected permissions diff --git a/tests/tests_sysconfig.yml b/tests/tests_sysconfig.yml index ebd34cf..2ccbf87 100644 --- a/tests/tests_sysconfig.yml +++ b/tests/tests_sysconfig.yml @@ -43,10 +43,10 @@ # these are string variants in default configuration file - "'SSH_USE_STRONG_RNG=0' not in config.content | b64decode" - "'# SSH_USE_STRONG_RNG=1' not in config.content | b64decode" - when: - - ansible_facts['os_family'] == "RedHat" - - ansible_facts['distribution'] != 'Fedora' tags: tests::verify + when: + - ansible_facts['os_family'] == "RedHat" + - ansible_facts['distribution'] != 'Fedora' - name: "Restore configuration files" include_tasks: tasks/restore.yml