From 0e9b1d27d4aaed541faec4ce40ad4d520bd0fe7a Mon Sep 17 00:00:00 2001 From: ace Date: Wed, 26 Jan 2022 18:17:28 +0300 Subject: [PATCH] use ansible_facts --- tasks/main.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/main.yaml b/tasks/main.yaml index 17fb922..020e97f 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -2,14 +2,14 @@ - name: Install libselinux-python package: name=libselinux-python state=present when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version <= '7' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] <= '7' - name: Install python3-libselinux package: name=python3-libselinux state=present when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version == '8' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] == '8' - name: 'Set selinux state' selinux: