Skip to content

Commit 8bca160

Browse files
jamescassellansibot
authored andcommittedAug 12, 2019
add vfat to selinux special_context_filesystems (ansible#59823)
vfat is the format of the /boot/efi partition on UEFI hosts and does not support SELinux labels add an environment variable for this config option
1 parent 6cb5b67 commit 8bca160

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
bugfixes:
3+
- vfat - changed default value of selinux_special_filesystems to include vfat,
4+
the filesystem of ``/boot/efi`` on UEFI systems
5+
minor_changes:
6+
- selinux_special_filesystems config can be specified via environment variable
7+
``ANSIBLE_SELINUX_SPECIAL_FS``

‎docs/docsite/rst/dev_guide/developing_program_flow_modules.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ files (changing attributes, moving, and copying). To set, add a comma separated
429429

430430
# ansible.cfg
431431
[selinux]
432-
special_context_filesystems=nfs,vboxsf,fuse,ramfs
432+
special_context_filesystems=nfs,vboxsf,fuse,ramfs,vfat
433433

434434
Most modules can use the built-in ``AnsibleModule`` methods to manipulate
435435
files. To access in a module that needs to know about these special context filesystems, instantiate an ``AnsibleModule`` and examine the list in

‎examples/ansible.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@
461461
# file systems that require special treatment when dealing with security context
462462
# the default behaviour that copies the existing context or uses the user default
463463
# needs to be changed to use the file system dependent context.
464-
#special_context_filesystems=nfs,vboxsf,fuse,ramfs,9p
464+
#special_context_filesystems=nfs,vboxsf,fuse,ramfs,9p,vfat
465465

466466
# Set this to yes to allow libvirt_lxc connections to work without SELinux.
467467
#libvirt_lxc_noseclabel = yes

‎lib/ansible/config/base.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -956,12 +956,14 @@ DEFAULT_SCP_IF_SSH:
956956
- {key: scp_if_ssh, section: ssh_connection}
957957
DEFAULT_SELINUX_SPECIAL_FS:
958958
name: Problematic file systems
959-
default: fuse, nfs, vboxsf, ramfs, 9p
959+
default: fuse, nfs, vboxsf, ramfs, 9p, vfat
960960
description:
961961
- "Some filesystems do not support safe operations and/or return inconsistent errors,
962962
this setting makes Ansible 'tolerate' those in the list w/o causing fatal errors."
963963
- Data corruption may occur and writes are not always verified when a filesystem is in the list.
964-
env: []
964+
env:
965+
- name: ANSIBLE_SELINUX_SPECIAL_FS
966+
version_added: "2.9"
965967
ini:
966968
- {key: special_context_filesystems, section: selinux}
967969
type: list

‎lib/ansible/module_utils/common/parameters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
'module_name': ('_name', None),
2929
'no_log': ('no_log', False),
3030
'remote_tmp': ('_remote_tmp', None),
31-
'selinux_special_fs': ('_selinux_special_fs', ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p']),
31+
'selinux_special_fs': ('_selinux_special_fs', ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p', 'vfat']),
3232
'shell_executable': ('_shell', '/bin/sh'),
3333
'socket': ('_socket_path', None),
3434
'string_conversion_action': ('_string_conversion_action', 'warn'),

0 commit comments

Comments
 (0)
Please sign in to comment.