Skip to content

Commit 90a7aa7

Browse files
authored
Merge pull request #1162 from ajdecon/selinux-disabled-fix
Check for SELinux disabled in Ansible tasks
2 parents 1fb0158 + 7582fe4 commit 90a7aa7

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

roles/nvidia-dgx/tasks/configure-raid.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@
1414

1515
- name: Restore SELinux label on RAID array
1616
command: restorecon /raid
17-
when: ansible_os_family == 'RedHat'
17+
when:
18+
- ansible_os_family == 'RedHat'
19+
- (ansible_selinux is defined) and (ansible_selinux.status != "disabled")
1820
notify: restart cachefilesd

roles/slurm/tasks/controller.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,15 @@
3939
target: '/lib64(/.*)?'
4040
setype: mysqld_db_t
4141
state: present
42-
when: ansible_os_family == "RedHat"
42+
when:
43+
- ansible_os_family == "RedHat"
44+
- (ansible_selinux is defined) and (ansible_selinux.status != "disabled")
4345

4446
- name: Apply new SELinux file context to filesystem
4547
command: restorecon -irv /lib64
46-
when: ansible_os_family == "RedHat"
48+
when:
49+
- ansible_os_family == "RedHat"
50+
- (ansible_selinux is defined) and (ansible_selinux.status != "disabled")
4751

4852
- name: start mariadb
4953
systemd:

0 commit comments

Comments
 (0)