Check whether ansible_selinux is defined

This commit is contained in:
Bert Van Vreckem 2017-05-09 13:46:38 +02:00
parent ccb2d871b9
commit f88f793cab

View File

@ -19,7 +19,7 @@
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: "{{ samba_selinux_packages }}" with_items: "{{ samba_selinux_packages }}"
when: ansible_selinux.status == 'enabled' when: ansible_selinux is defined and ansible_selinux.status == 'enabled'
tags: samba tags: samba
- name: Make sure SELinux boolean settings are correct - name: Make sure SELinux boolean settings are correct
@ -28,7 +28,7 @@
state: yes state: yes
persistent: yes persistent: yes
with_items: "{{ samba_selinux_booleans }}" with_items: "{{ samba_selinux_booleans }}"
when: ansible_selinux.status == 'enabled' when: ansible_selinux is defined and ansible_selinux.status == 'enabled'
tags: samba tags: samba
- name: Create Samba shares root directory - name: Create Samba shares root directory