2020-12-21 01:18:32 -06:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
# Webservers
|
|
|
|
---
|
|
|
|
- hosts: web1.desu.ltd
|
2020-12-31 20:11:09 -06:00
|
|
|
tasks:
|
|
|
|
- name: configure nextcloud cronjob
|
2020-12-31 22:23:26 -06:00
|
|
|
cron: user=www-data name=nextcloud minute=*/5 job="php -f /var/www/nc.desu.ltd/cron.php"
|
2020-12-31 20:11:09 -06:00
|
|
|
become: yes
|
|
|
|
tags: [ nextcloud, cron ]
|
2020-12-21 01:18:32 -06:00
|
|
|
roles:
|
2020-12-24 09:19:12 -06:00
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
|
|
|
- /var/lib/gitea
|
2020-12-30 15:32:44 -06:00
|
|
|
- /var/www/nc.desu.ltd
|
2020-12-30 15:31:44 -06:00
|
|
|
- /var/www/www.9iron.club/files
|
2020-12-30 18:05:57 -06:00
|
|
|
- /srv/desu.ltd
|
2021-01-14 18:06:13 -06:00
|
|
|
backup_s3backup_exclude_list_extra:
|
|
|
|
- /var/lib/gitea/log
|
2020-12-24 09:19:12 -06:00
|
|
|
become: yes
|
|
|
|
tags: [ backup ]
|
2020-12-30 16:37:22 -06:00
|
|
|
- role: certbot
|
|
|
|
vars:
|
|
|
|
certbot_admin_email: rehashedsalt@cock.li
|
|
|
|
certbot_create_if_missing: yes
|
|
|
|
certbot_create_method: standalone
|
|
|
|
certbot_create_standalone_stop_services:
|
|
|
|
- apache2
|
|
|
|
certbot_certs:
|
|
|
|
- domains:
|
|
|
|
- desu.ltd
|
|
|
|
- git.desu.ltd
|
|
|
|
- nc.desu.ltd
|
|
|
|
- web1.desu.ltd
|
|
|
|
- 9iron.club
|
|
|
|
- www.9iron.club
|
2020-12-30 16:56:07 -06:00
|
|
|
- otwstudios.org
|
2020-12-30 16:37:22 -06:00
|
|
|
become: yes
|
|
|
|
tags: [ web, certbot ]
|
|
|
|
- role: php
|
|
|
|
vars:
|
|
|
|
php_enable_php_fpm: yes
|
|
|
|
php_memory_limit: 512M
|
|
|
|
php_packages_extra:
|
|
|
|
- libapache2-mod-php
|
|
|
|
- php-zip # For Nextcloud
|
|
|
|
- php-intl
|
|
|
|
- php-imagick
|
|
|
|
- php-redis
|
|
|
|
- php-bcmath
|
|
|
|
- php-gmp
|
|
|
|
- php-pgsql # For general DB stuff
|
|
|
|
# Nextcloud recommended opcache settings
|
|
|
|
php_opcache_max_accelerated_files: 10000
|
|
|
|
php_opcache_memory_consumption: 128
|
|
|
|
php_opcache_revalidate_freq: 2
|
|
|
|
become: yes
|
|
|
|
tags: [ web, php ]
|
2020-12-21 01:18:32 -06:00
|
|
|
- role: apache
|
|
|
|
vars:
|
|
|
|
apache_remove_default_vhost: yes
|
|
|
|
apache_packages_state: latest
|
|
|
|
apache_mods_enabled:
|
2020-12-29 10:01:46 -06:00
|
|
|
- headers.load
|
2020-12-30 16:37:22 -06:00
|
|
|
- http2.load
|
|
|
|
- mpm_worker.load
|
2020-12-21 01:18:32 -06:00
|
|
|
- proxy.load
|
2020-12-30 16:37:22 -06:00
|
|
|
- proxy_fcgi.load
|
2020-12-21 01:18:32 -06:00
|
|
|
- proxy_http.load
|
|
|
|
- rewrite.load
|
2020-12-30 16:37:22 -06:00
|
|
|
- ssl.load
|
|
|
|
apache_mods_disabled:
|
|
|
|
- mpm_prefork.load
|
|
|
|
- php7.4.load
|
|
|
|
apache_global_vhost_settings: |
|
|
|
|
DirectoryIndex index.php index.html
|
|
|
|
Protocols h2 http/1.1
|
|
|
|
<FilesMatch \.php$>
|
2020-12-30 17:06:00 -06:00
|
|
|
SetHandler "proxy:fcgi://127.0.0.1:9000"
|
2020-12-30 16:37:22 -06:00
|
|
|
</FilesMatch>
|
2020-12-21 01:18:32 -06:00
|
|
|
apache_vhosts:
|
2020-12-30 15:31:44 -06:00
|
|
|
# desu.ltd
|
2020-12-21 01:18:32 -06:00
|
|
|
- servername: desu.ltd
|
|
|
|
extra_parameters: |
|
2020-12-30 17:10:46 -06:00
|
|
|
Redirect permanent / https://desu.ltd/
|
2020-12-21 01:18:32 -06:00
|
|
|
- servername: git.desu.ltd
|
|
|
|
extra_parameters: |
|
2020-12-30 17:10:46 -06:00
|
|
|
Redirect permanent / https://git.desu.ltd/
|
2020-12-31 21:34:04 -06:00
|
|
|
- servername: nc.desu.ltd
|
|
|
|
extra_parameters: |
|
|
|
|
Redirect permanent / https://nc.desu.ltd/
|
2020-12-30 15:31:44 -06:00
|
|
|
# 9iron.club
|
|
|
|
- servername: 9iron.club
|
|
|
|
extra_parameters: |
|
2020-12-30 17:10:46 -06:00
|
|
|
Redirect permanent / https://www.9iron.club/
|
2020-12-30 15:31:44 -06:00
|
|
|
- servername: www.9iron.club
|
|
|
|
extra_parameters: |
|
2020-12-30 17:10:46 -06:00
|
|
|
Redirect permanent / https://www.9iron.club/
|
2020-12-21 01:18:32 -06:00
|
|
|
apache_vhosts_ssl:
|
2020-12-30 15:31:44 -06:00
|
|
|
# desu.ltd
|
2020-12-21 01:18:32 -06:00
|
|
|
- servername: desu.ltd
|
2020-12-29 09:11:57 -06:00
|
|
|
documentroot: /var/www/desu.ltd
|
2020-12-21 01:18:32 -06:00
|
|
|
certificate_file: /etc/letsencrypt/live/desu.ltd/fullchain.pem
|
|
|
|
certificate_key_file: /etc/letsencrypt/live/desu.ltd/privkey.pem
|
|
|
|
certificate_chain_file: /etc/letsencrypt/live/desu.ltd/chain.pem
|
|
|
|
- servername: git.desu.ltd
|
|
|
|
extra_parameters: |
|
|
|
|
ProxyPreserveHost On
|
|
|
|
ProxyRequests Off
|
|
|
|
ProxyPass / http://127.0.0.1:3000/ nocanon retry=1
|
|
|
|
certificate_file: /etc/letsencrypt/live/desu.ltd/fullchain.pem
|
|
|
|
certificate_key_file: /etc/letsencrypt/live/desu.ltd/privkey.pem
|
|
|
|
certificate_chain_file: /etc/letsencrypt/live/desu.ltd/chain.pem
|
2020-12-31 21:34:04 -06:00
|
|
|
- servername: nc.desu.ltd
|
|
|
|
extra_parameters: |
|
|
|
|
Header always set Strict-Transport-Security "max-age=31536000"
|
|
|
|
documentroot: /var/www/nc.desu.ltd
|
|
|
|
certificate_file: /etc/letsencrypt/live/desu.ltd/fullchain.pem
|
|
|
|
certificate_key_file: /etc/letsencrypt/live/desu.ltd/privkey.pem
|
|
|
|
certificate_chain_file: /etc/letsencrypt/live/desu.ltd/chain.pem
|
2020-12-30 15:31:44 -06:00
|
|
|
# 9iron.club
|
|
|
|
- servername: 9iron.club
|
|
|
|
extra_parameters: |
|
2020-12-30 17:10:46 -06:00
|
|
|
Redirect permanent / https://www.9iron.club/
|
2020-12-30 15:31:44 -06:00
|
|
|
certificate_file: /etc/letsencrypt/live/desu.ltd/fullchain.pem
|
|
|
|
certificate_key_file: /etc/letsencrypt/live/desu.ltd/privkey.pem
|
|
|
|
certificate_chain_file: /etc/letsencrypt/live/desu.ltd/chain.pem
|
|
|
|
- servername: www.9iron.club
|
|
|
|
documentroot: /var/www/www.9iron.club
|
|
|
|
certificate_file: /etc/letsencrypt/live/desu.ltd/fullchain.pem
|
|
|
|
certificate_key_file: /etc/letsencrypt/live/desu.ltd/privkey.pem
|
|
|
|
certificate_chain_file: /etc/letsencrypt/live/desu.ltd/chain.pem
|
2020-12-30 16:56:07 -06:00
|
|
|
# otwstudios.org
|
|
|
|
- servername: otwstudios.org
|
|
|
|
extra_parameters: |
|
2020-12-30 17:10:46 -06:00
|
|
|
Redirect permanent / https://www.otwstudios.org/
|
2020-12-30 16:56:07 -06:00
|
|
|
certificate_file: /etc/letsencrypt/live/desu.ltd/fullchain.pem
|
|
|
|
certificate_key_file: /etc/letsencrypt/live/desu.ltd/privkey.pem
|
|
|
|
certificate_chain_file: /etc/letsencrypt/live/desu.ltd/chain.pem
|
|
|
|
- servername: www.otwstudios.org
|
|
|
|
documentroot: /var/www/www.otwstudios.org
|
|
|
|
certificate_file: /etc/letsencrypt/live/desu.ltd/fullchain.pem
|
|
|
|
certificate_key_file: /etc/letsencrypt/live/desu.ltd/privkey.pem
|
|
|
|
certificate_chain_file: /etc/letsencrypt/live/desu.ltd/chain.pem
|
2020-12-21 01:18:32 -06:00
|
|
|
become: yes
|
|
|
|
tags: [ web, apache ]
|
|
|
|
- role: git
|
|
|
|
vars:
|
|
|
|
git_repos:
|
2020-12-30 21:35:59 -06:00
|
|
|
- repo: https://git.desu.ltd/salt/desultd
|
2020-12-29 09:11:57 -06:00
|
|
|
dest: /var/www/desu.ltd
|
2020-12-30 21:35:59 -06:00
|
|
|
- repo: https://git.desu.ltd/salt/9iron
|
2020-12-30 15:31:44 -06:00
|
|
|
dest: /var/www/www.9iron.club
|
2020-12-31 18:52:02 -06:00
|
|
|
- repo: https://git.desu.ltd/salt/gitea-custom
|
2020-12-31 19:22:58 -06:00
|
|
|
dest: /usr/local/bin/custom
|
2020-12-21 01:18:32 -06:00
|
|
|
become: yes
|
|
|
|
tags: [ web, git ]
|
|
|
|
- role: nextcloud
|
|
|
|
vars:
|
2020-12-29 09:11:57 -06:00
|
|
|
nextcloud_installation_dir: /var/www/nc.desu.ltd
|
2020-12-30 18:05:57 -06:00
|
|
|
nextcloud_data_dir: /srv/desu.ltd/nc
|
2020-12-21 01:18:32 -06:00
|
|
|
nextcloud_admin_user: admin
|
|
|
|
nextcloud_admin_pass: "{{ secret_nextcloud_admin_pass }}"
|
|
|
|
nextcloud_version: 19
|
|
|
|
nextcloud_urls:
|
|
|
|
- http://nc.desu.ltd:80
|
|
|
|
- https://nc.desu.ltd:443
|
|
|
|
nextcloud_config:
|
|
|
|
system:
|
|
|
|
trusted_domains:
|
|
|
|
"{{ nextcloud_urls | map('urlsplit', 'hostname') | list }}"
|
|
|
|
nextcloud_database:
|
|
|
|
backend: pgsql
|
2020-12-29 09:06:08 -06:00
|
|
|
name: nextcloud-desultd
|
|
|
|
user: nextcloud-desultd
|
2020-12-21 01:18:32 -06:00
|
|
|
pass: "{{ secret_nextcloud_db_pass }}"
|
|
|
|
host: 192.168.164.156
|
|
|
|
port: 5432
|
|
|
|
become: yes
|
|
|
|
tags: [ web, nextcloud ]
|
|
|
|
- role: gitea
|
|
|
|
vars:
|
|
|
|
# Look and feel
|
|
|
|
gitea_app_name: "Git Desu"
|
|
|
|
# Core config
|
|
|
|
gitea_db_type: postgres
|
|
|
|
gitea_db_host: 192.168.164.156:5432
|
2020-12-29 09:06:08 -06:00
|
|
|
gitea_db_name: gitea-desultd
|
|
|
|
gitea_db_user: gitea-desultd
|
2020-12-21 01:18:32 -06:00
|
|
|
gitea_db_password: "{{ secret_gitea_db_pass }}"
|
|
|
|
gitea_http_domain: git.desu.ltd
|
|
|
|
gitea_oauth2_enabled: no
|
2020-12-30 18:05:57 -06:00
|
|
|
gitea_repository_root: /srv/desu.ltd/git
|
2020-12-30 21:52:32 -06:00
|
|
|
gitea_require_signin: no
|
2020-12-21 01:18:32 -06:00
|
|
|
gitea_root_url: https://git.desu.ltd
|
|
|
|
gitea_shell: "/bin/bash"
|
|
|
|
gitea_ssh_domain: git.desu.ltd
|
|
|
|
gitea_ssh_port: 22
|
|
|
|
gitea_start_ssh: no
|
|
|
|
gitea_user: git
|
|
|
|
become: yes
|
|
|
|
tags: [ web, gitea ]
|