From f88f793caba146bc7128ee46505b42dccce719c6 Mon Sep 17 00:00:00 2001 From: Bert Van Vreckem Date: Tue, 9 May 2017 13:46:38 +0200 Subject: [PATCH] Check whether ansible_selinux is defined --- tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 5d9b626..dd7a7a6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -19,7 +19,7 @@ name: "{{ item }}" state: present with_items: "{{ samba_selinux_packages }}" - when: ansible_selinux.status == 'enabled' + when: ansible_selinux is defined and ansible_selinux.status == 'enabled' tags: samba - name: Make sure SELinux boolean settings are correct @@ -28,7 +28,7 @@ state: yes persistent: yes with_items: "{{ samba_selinux_booleans }}" - when: ansible_selinux.status == 'enabled' + when: ansible_selinux is defined and ansible_selinux.status == 'enabled' tags: samba - name: Create Samba shares root directory