Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix selinux context on caddy log dir #32

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -16,6 +16,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