From 2715baca1e4ff387b3b01e71ca385305bc23fe3f Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Thu, 8 Oct 2020 12:48:56 +0200 Subject: [PATCH] Fix SELinux facts (#337) --- CHANGELOG.md | 1 + tasks/prerequisites/prerequisites.yml | 3 ++- tasks/prerequisites/setup-selinux.yml | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b20aea..faeb1e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ENHANCEMENTS: BUG FIXES: * Prevent TravisCI from trying to build (and failing) NGINX Plus images on external PRs. +* Fix naming for SELinux facts dict. ## 0.17.2 (September 24, 2020) diff --git a/tasks/prerequisites/prerequisites.yml b/tasks/prerequisites/prerequisites.yml index 28d32a8..03c8a9a 100644 --- a/tasks/prerequisites/prerequisites.yml +++ b/tasks/prerequisites/prerequisites.yml @@ -11,8 +11,9 @@ - name: Configure SELinux include_tasks: "{{ role_path }}/tasks/prerequisites/setup-selinux.yml" - when: ansible_facts['selinux.mode'] is defined + when: ansible_facts['selinux']['mode'] is defined when: - nginx_selinux | bool + - "'selinux' in ansible_facts" - ansible_facts['os_family'] in ['RedHat', 'Suse'] - ansible_facts['distribution'] not in ['Amazon', 'OracleLinux'] diff --git a/tasks/prerequisites/setup-selinux.yml b/tasks/prerequisites/setup-selinux.yml index 95c1689..d02df3a 100644 --- a/tasks/prerequisites/setup-selinux.yml +++ b/tasks/prerequisites/setup-selinux.yml @@ -22,7 +22,7 @@ state: permissive policy: targeted changed_when: false - when: ansible_facts['selinux.mode'] == "enforcing" + when: ansible_facts['selinux']['mode'] == "enforcing" - name: Allow SELinux HTTP network connections seboolean: @@ -99,4 +99,4 @@ changed_when: false when: - nginx_selinux_enforcing | bool - - ansible_facts['selinux.mode'] == "permissive" + - ansible_facts['selinux']['mode'] == "permissive"