self-hosting/roles/forgejo/tasks/apache2.yml

37 lines
850 B
YAML
Raw Normal View History

2023-01-16 11:21:14 +01:00
---
2024-04-09 20:21:59 +02:00
- name: Enable needed modules
2023-01-16 11:21:14 +01:00
become: true
community.general.apache2_module:
name: "{{ item }}"
state: present
with_items:
- proxy
- proxy_http
- rewrite
- ssl
2023-01-16 11:21:14 +01:00
notify: Reload apache2 service
- name: Copy vHost conf
become: true
ansible.builtin.template:
2023-10-01 17:30:38 +02:00
src: apache2/vhost.conf.j2
dest: /etc/apache2/sites-available/{{ forgejo_domain }}.conf
2023-01-16 11:21:14 +01:00
mode: 0644
notify: Reload apache2 service
- name: Activate vHost
become: true
2023-10-01 17:30:38 +02:00
ansible.builtin.command: "a2ensite {{ forgejo_domain }}.conf"
2023-01-16 11:21:14 +01:00
register: result
changed_when: "'already enabled' not in result.stdout"
notify: Reload apache2 service
2024-07-06 20:41:24 +02:00
- name: Allow incoming https
become: true
ansible.builtin.copy:
src: nftables/input.d/https.conf
dest: /etc/nftables/input.d/https.conf
mode: 0640
notify: Reload nftables service