ansible-koji/roles/caddy/tasks/main.yaml
Rénich Bon Ćirić b7c28ade88
refactor: change repository path to /srv/www/repo for SELinux compliance
- Update Caddy tasks and templates to serve from /srv/www/repo.
- Update Koji Hub export script to target /srv/www/repo/.
- Redeploy Caddy config via Ansible.
- Update ADR-05 and package compilation documentation.
- Log progress in the project journal.

Co-developed-by: Gemini AI <renich+gemini@woralelandia.com>
Signed-off-by: Rénich Bon Ćirić <renich@woralelandia.com>
2026-06-16 16:52:29 -06:00

44 lines
1 KiB
YAML

---
- name: Enable Caddy Copr repository
ansible.builtin.command: dnf copr enable -y @caddy/caddy
args:
creates: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:group_caddy:caddy.repo
- name: Install Caddy
ansible.builtin.dnf:
name: caddy
state: present
- name: Create repository directory
ansible.builtin.file:
path: /srv/www/repo
state: directory
mode: '0755'
owner: root
group: root
- name: Deploy Caddyfile
ansible.builtin.template:
src: Caddyfile.j2
dest: /etc/caddy/Caddyfile
owner: root
group: root
mode: '0644'
notify: Restart caddy
- name: Gather service facts
ansible.builtin.service_facts:
- name: Allow HTTP port in firewalld
ansible.builtin.firewalld:
service: http
permanent: true
state: enabled
immediate: true
when: ansible_facts.services['firewalld.service'] is defined and ansible_facts.services['firewalld.service'].state == 'running'
- name: Ensure Caddy is started and enabled
ansible.builtin.systemd:
name: caddy
state: started
enabled: true