sefcontext
Collection: community.general
Full Name: parallax.community.general.sefcontext
Aliases: community.general.sefcontext, sefcontext
Synopsis
Manage SELinux file context mappings
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| target | string | yes | Target file or directory path specification (supports regex) | |
| setype | string | yes | SELinux type for the file context | |
| state | string | present | Whether the context should be present or absent | |
| ftype | string | a | File type (a=all, f=file, d=directory, c=char, b=block, s=socket, l=symlink, p=pipe) | |
| selevel | string | SELinux range/level for MLS/MCS | ||
| seuser | string | SELinux user for the file context | ||
| reload | bool | true | Reload 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