Skip to content

Commit cd36168

Browse files
committed
playbooks: apply SELinux context to nginx.sock
Signed-off-by: Paolo Bonzini <[email protected]>
1 parent e9e3e60 commit cd36168

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/playbooks/deploy-servers.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@
3131
file:
3232
path: "{{ data_dir }}"
3333
state: directory
34+
- name: Configuring SELinux file context
35+
sefcontext:
36+
setype: httpd_var_run_t
37+
target: "{{ data_dir }}/nginx.sock"
38+
become: true
39+
- name: Check whether a preexisting socket exists
40+
stat:
41+
path: "{{ data_dir }}/nginx.sock"
42+
register: nginx_sock
43+
- name: Apply new SELinux file context to filesystem
44+
command: "restorecon -v {{ data_dir }}/nginx.sock"
45+
become: true
46+
when: nginx_sock.stat.exists
3447
- name: Create podman network
3548
containers.podman.podman_network:
3649
name: patchew

0 commit comments

Comments
 (0)