sefcontext

Collection: community.general

Full Name: parallax.community.general.sefcontext

Aliases: community.general.sefcontext, sefcontext

Synopsis

Manage SELinux file context mappings

Parameters

NameTypeRequiredDefaultDescription
targetstringyesTarget file or directory path specification (supports regex)
setypestringyesSELinux type for the file context
statestringpresentWhether the context should be present or absent
ftypestringaFile type (a=all, f=file, d=directory, c=char, b=block, s=socket, l=symlink, p=pipe)
selevelstringSELinux range/level for MLS/MCS
seuserstringSELinux user for the file context
reloadbooltrueReload SELinux policy after commit

Example

- name: Label the application data directory
  sefcontext:
    target: "/srv/app/data(/.*)?"
    setype: httpd_sys_rw_content_t
    state: present
    reload: true