27 lines
651 B
YAML
27 lines
651 B
YAML
---
|
|
- name: Enable needed modules
|
|
become: true
|
|
community.general.apache2_module:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items:
|
|
- proxy
|
|
- proxy_http
|
|
- rewrite
|
|
- ssl
|
|
notify: Reload apache2 service
|
|
|
|
- name: Copy vHost conf
|
|
become: true
|
|
ansible.builtin.template:
|
|
src: apache2/vhost.conf.j2
|
|
dest: /etc/apache2/sites-available/{{ forgejo_domain }}.conf
|
|
mode: 0644
|
|
notify: Reload apache2 service
|
|
|
|
- name: Activate vHost
|
|
become: true
|
|
ansible.builtin.command: "a2ensite {{ forgejo_domain }}.conf"
|
|
register: result
|
|
changed_when: "'already enabled' not in result.stdout"
|
|
notify: Reload apache2 service
|