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

26 lines
626 B
YAML
Raw Normal View History

2023-01-16 11:21:14 +01:00
---
- name: Enable proxy modules
become: true
community.general.apache2_module:
name: "{{ item }}"
state: present
with_items:
- proxy
- proxy_http
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