Add role gitea-apache2
This commit is contained in:
parent
ecdb15c942
commit
9616ab751b
5 changed files with 57 additions and 0 deletions
3
roles/gitea-apache2/meta/main.yml
Normal file
3
roles/gitea-apache2/meta/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
dependencies:
|
||||
- role: setup-apache2
|
||||
- role: certbot
|
23
roles/gitea-apache2/tasks/main.yml
Normal file
23
roles/gitea-apache2/tasks/main.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
- name: Enable proxy modules
|
||||
become: true
|
||||
apache2_module:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items:
|
||||
- proxy
|
||||
- proxy_http
|
||||
notify: Reload apache2 service
|
||||
|
||||
- name: Copy vHost conf
|
||||
become: true
|
||||
template:
|
||||
src: git.tunuifranken.info.conf.j2
|
||||
dest: /etc/apache2/sites-available/git.tunuifranken.info.conf
|
||||
notify: Reload apache2 service
|
||||
|
||||
- name: Activate vHost
|
||||
become: true
|
||||
command: a2ensite git.tunuifranken.info.conf
|
||||
register: result
|
||||
changed_when: "'already enabled' not in result.stdout"
|
||||
notify: Reload apache2 service
|
28
roles/gitea-apache2/templates/git.tunuifranken.info.conf.j2
Normal file
28
roles/gitea-apache2/templates/git.tunuifranken.info.conf.j2
Normal file
|
@ -0,0 +1,28 @@
|
|||
<VirtualHost *:80>
|
||||
ServerName git.tunuifranken.info
|
||||
ServerAdmin {{ server_admin_email_gitea }}
|
||||
DocumentRoot /var/www/empty
|
||||
|
||||
RewriteEngine on
|
||||
RewriteCond %{SERVER_NAME} =git.tunuifranken.info
|
||||
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/git.tunuifranken.info.error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/git.tunuifranken.info.access.log combined
|
||||
</VirtualHost>
|
||||
<VirtualHost *:443>
|
||||
ServerName git.tunuifranken.info
|
||||
ServerAdmin {{ server_admin_email_gitea }}
|
||||
|
||||
ProxyPreserveHost On
|
||||
ProxyRequests off
|
||||
AllowEncodedSlashes NoDecode
|
||||
ProxyPass / http://localhost:3000/ nocanon
|
||||
ProxyPassReverse / http://localhost:3000/
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/git.tunuifranken.info.error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/git.tunuifranken.info.access.log combined
|
||||
|
||||
#SSLCertificateFile /etc/letsencrypt/live/git.tunuifranken.info/fullchain.pem
|
||||
#SSLCertificateKeyFile /etc/letsencrypt/live/git.tunuifranken.info/privkey.pem
|
||||
</VirtualHost>
|
2
roles/gitea-apache2/vars/main.yml
Normal file
2
roles/gitea-apache2/vars/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
server_admin_email_gitea: tfranken@protonmail.com
|
|
@ -1,3 +1,4 @@
|
|||
dependencies:
|
||||
- role: gitea-fail2ban
|
||||
- role: gitea-mariadb
|
||||
- role: gitea-apache2
|
||||
|
|
Loading…
Reference in a new issue