ceuser@deyu:~/ansible_pb$ ansible-doc sefcontext
ceuser@deyu:~/ansible_pb$ ansible-doc dnf | grep ^EX -A5
EXAMPLES:
- name: Install the latest version of Apache
ansible.builtin.dnf:
name: httpd
state: latest
httpd_git_rw_content_t。
ceuser@deyu:~/ansible_pb$ ansible-doc sefcontext | grep ^EX -A6
EXAMPLES:
- name: Allow apache to modify files in /srv/git_repos
community.general.sefcontext:
target: '/srv/git_repos(/.*)?'
setype: httpd_git_rw_content_t
state: present
ceuser@deyu:~/ansible_pb$ ansible-doc sefcontext | grep 'Apply new SELinux' -A1 - name: Apply new SELinux file context to filesystem ansible.builtin.command: restorecon -irv /srv/git_repos