selinux file context fixes for nginx data directories

This commit is contained in:
Timo Makinen 2019-06-11 15:53:55 +03:00
parent 5016b70292
commit 8920d79078

View file

@ -7,6 +7,11 @@
name: nginx
state: installed
- name: fix selinux contexts from data directory
sefcontext:
path: /srv/web(/.*)?
setype: httpd_sys_content_t
when: ansible_selinux_python_present == true
- name: create nginx data and config directories
file:
state: directory
@ -14,17 +19,13 @@
mode: 0755
owner: root
group: "{{ ansible_wheel }}"
seuser: _default
setype: _default
with_items:
- /srv/web
- "/srv/web/{{ inventory_hostname }}"
- "/etc/nginx/conf.d/{{ inventory_hostname }}"
- name: fix selinux contexts from data directory
sefcontext:
path: /srv/web(/.*)?
setype: httpd_sys_content_t
when: ansible_selinux_python_present == true
- name: create nginx base config
template:
src: nginx.conf.j2