Skip to content

Commit

Permalink
fix selinux context on caddy log dir (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanspw authored Aug 15, 2024
1 parent c0793b8 commit 13eb639
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions roles/matrix_synapse/tasks/caddy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
tags:
- caddy

- name: Set SELinux context for log directory
community.general.sefcontext:
target: '/var/log/caddy(/.*)?'
setype: httpd_sys_rw_content_t
state: present
register: set_selinux_context

# need to apply new contexts "now" to prevent potential issues in later tasks
- name: Apply new SELinux file context to filesystem # noqa no-handler no-changed-when
ansible.builtin.command: restorecon -irv /var/log/caddy
when: set_selinux_context.changed

- name: Distribute /etc/caddy/Caddyfile
ansible.builtin.template:
src: Caddyfile.j2
Expand Down
16 changes: 16 additions & 0 deletions roles/mirror/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@
tags:
- caddy

- name: Set SELinux context for log directory
community.general.sefcontext:
target: '/var/log/caddy(/.*)?'
setype: httpd_sys_rw_content_t
state: present
register: set_selinux_context
tags:
- caddy

# need to apply new contexts "now" to prevent potential issues in later tasks
- name: Apply new SELinux file context to filesystem # noqa no-handler no-changed-when
ansible.builtin.command: restorecon -irv /var/log/caddy
when: set_selinux_context.changed
tags:
- caddy

- name: Distribute /etc/caddy/Caddyfile
ansible.builtin.template:
src: etc/caddy/Caddyfile.j2
Expand Down

0 comments on commit 13eb639

Please sign in to comment.