Git history was lost when the previous Gitea instance was wiped and reinstalled due to an unresolved corruption bug — this commit is the last known-good file content, exported before the reinstall. Prior commit history is not recoverable through this path.
50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
---
|
|
- name: Update apt cache
|
|
ansible.builtin.apt:
|
|
update_cache: yes
|
|
cache_valid_time: 3600
|
|
|
|
- name: Install Apache
|
|
ansible.builtin.apt:
|
|
name: apache2
|
|
state: present
|
|
|
|
- name: Enable mod_rewrite
|
|
ansible.builtin.command:
|
|
cmd: a2enmod rewrite
|
|
creates: /etc/apache2/mods-enabled/rewrite.load
|
|
notify: Restart Apache
|
|
|
|
- name: Create website root directory
|
|
ansible.builtin.file:
|
|
path: "/var/www/{{ domain_name }}"
|
|
state: directory
|
|
owner: www-data
|
|
group: www-data
|
|
mode: '0755'
|
|
|
|
- name: Configure virtual host
|
|
ansible.builtin.template:
|
|
src: vhost.conf.j2
|
|
dest: "/etc/apache2/sites-available/{{ domain_name }}.conf"
|
|
mode: '0644'
|
|
notify: Restart Apache
|
|
|
|
- name: Enable virtual host
|
|
ansible.builtin.command:
|
|
cmd: "a2ensite {{ domain_name }}.conf"
|
|
creates: "/etc/apache2/sites-enabled/{{ domain_name }}.conf"
|
|
notify: Restart Apache
|
|
|
|
- name: Disable default site
|
|
ansible.builtin.command:
|
|
cmd: a2dissite 000-default.conf
|
|
ignore_errors: yes
|
|
notify: Restart Apache
|
|
|
|
- name: Start and enable Apache
|
|
ansible.builtin.systemd:
|
|
name: apache2
|
|
state: started
|
|
enabled: yes
|