From 63dd7c88be6f51eda3b247155d4f926b2b64c843 Mon Sep 17 00:00:00 2001
From: Pascal de Bruijn
Date: Tue, 14 Jun 2022 14:22:39 +0200
Subject: [PATCH] fix(googleauth): handle disabled selinux
---
users/googleauth.sls | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/users/googleauth.sls b/users/googleauth.sls
index d7baae8..e22da4d 100644
--- a/users/googleauth.sls
+++ b/users/googleauth.sls
@@ -15,7 +15,7 @@ users_{{ users.googleauth_dir }}:
- group: {{ users.root_group }}
- mode: '0700'
-{%- if grains['os_family'] == 'RedHat' %}
+{%- if grains['os_family'] == 'RedHat' and "selinux" in grains and grains.selinux.enabled %}
policycoreutils-package:
pkg.installed:
- pkgs:
@@ -67,7 +67,7 @@ users_googleauth-pam-{{ svc }}-{{ name }}:
{%- endif %}
{%- endfor %}
-{%- if grains['os_family'] == 'RedHat' %}
+{%- if grains['os_family'] == 'RedHat' and "selinux" in grains and grains.selinux.enabled %}
users_googleauth_selinux_applied:
selinux.fcontext_policy_applied:
- name: {{ users.googleauth_dir }}