2020-12-21 01:18:32 -06:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
# Webservers
|
|
|
|
---
|
|
|
|
- hosts: web1.desu.ltd
|
2021-01-18 05:03:46 -06:00
|
|
|
vars_files:
|
|
|
|
- vars/apache.yml
|
|
|
|
- vars/php-fpm.yml
|
|
|
|
- vars/desultd-apache.yml
|
|
|
|
- vars/desultd-certbot.yml
|
|
|
|
- vars/desultd-nextcloud.yml
|
2021-06-18 12:39:21 -05:00
|
|
|
module_defaults:
|
|
|
|
docker_container:
|
|
|
|
state: started
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
2021-03-25 12:59:40 -05:00
|
|
|
tasks:
|
2021-08-24 00:31:11 -05:00
|
|
|
- name: ensure docker network
|
|
|
|
docker_network: name=web
|
|
|
|
tags: [ docker ]
|
|
|
|
- name: ensure docker nginx config
|
|
|
|
copy:
|
|
|
|
dest: /data/nginx-certbot/user_conf.d/vhosts.conf
|
|
|
|
mode: "0750"
|
|
|
|
content: |
|
|
|
|
server {
|
|
|
|
listen 443 ssl default_server;
|
|
|
|
server_name desu.ltd;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://desultd:80;
|
|
|
|
}
|
|
|
|
}
|
2021-08-24 00:32:33 -05:00
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name www.9iron.club;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
2021-08-24 00:35:41 -05:00
|
|
|
return 301 $scheme://9iron.club$request_uri;
|
2021-08-24 00:32:33 -05:00
|
|
|
}
|
2021-08-24 00:31:11 -05:00
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name 9iron.club;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://9iron:80;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name git.desu.ltd;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://gitea:3000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name nc.desu.ltd;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://nextcloud:80;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name srv.9iron.club;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://srv:80;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tags: [ docker, ingress ]
|
2021-08-07 16:49:24 -05:00
|
|
|
- name: include tasks for apps
|
|
|
|
include_tasks: tasks/app/{{ task }}
|
|
|
|
with_items:
|
|
|
|
- gulagbot.yml
|
|
|
|
loop_control:
|
|
|
|
loop_var: task
|
|
|
|
tags: [ always ]
|
|
|
|
- name: include tasks for web services
|
|
|
|
include_tasks: tasks/web/{{ task }}
|
|
|
|
with_items:
|
|
|
|
- 9iron.yml
|
|
|
|
- desultd.yml
|
|
|
|
- gitea.yml
|
2021-08-24 00:31:11 -05:00
|
|
|
- nextcloud.yml
|
|
|
|
- srv.yml
|
|
|
|
- ingress-generic.yml
|
2021-08-07 16:49:24 -05:00
|
|
|
loop_control:
|
|
|
|
loop_var: task
|
|
|
|
tags: [ always ]
|
2021-03-25 12:59:40 -05:00
|
|
|
- name: configure nextcloud cronjob
|
|
|
|
cron: user=www-data name=nextcloud minute=*/5 job="php -f /var/www/nc.desu.ltd/cron.php"
|
|
|
|
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:
|
2021-06-14 17:16:48 -05:00
|
|
|
- /app/gitea/gitea
|
2021-03-25 12:46:53 -05:00
|
|
|
- /data
|
2020-12-30 15:32:44 -06:00
|
|
|
- /var/www/nc.desu.ltd
|
2021-05-11 22:28:19 -05:00
|
|
|
- /var/www/srv.9iron.club
|
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
|
2021-06-14 17:16:26 -05:00
|
|
|
- /data/gitea/data/gitea/log
|
2020-12-24 09:19:12 -06:00
|
|
|
tags: [ backup ]
|
2021-01-18 05:03:46 -06:00
|
|
|
- role: git
|
|
|
|
vars:
|
|
|
|
git_repos:
|
|
|
|
- repo: https://git.desu.ltd/salt/gitea-custom
|
2021-06-14 17:16:26 -05:00
|
|
|
dest: /data/gitea/data/gitea/custom
|
2021-01-18 05:03:46 -06:00
|
|
|
tags: [ web, git ]
|
2021-01-26 04:25:27 -06:00
|
|
|
- hosts: web2.desu.ltd
|
2021-06-07 00:45:52 -05:00
|
|
|
module_defaults:
|
|
|
|
docker_container:
|
|
|
|
state: started
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
2021-06-03 20:34:48 -05:00
|
|
|
tasks:
|
|
|
|
- name: ensure docker network
|
|
|
|
docker_network: name=web
|
|
|
|
tags: [ docker ]
|
|
|
|
- name: ensure docker nginx config
|
|
|
|
copy:
|
|
|
|
dest: /data/nginx-certbot/user_conf.d/vhosts.conf
|
|
|
|
mode: "0750"
|
|
|
|
content: |
|
|
|
|
server {
|
|
|
|
listen 443 ssl default_server;
|
|
|
|
server_name cowfee.moe;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/cowfee.moe/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/cowfee.moe/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/cowfee.moe/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://pleroma:4000;
|
|
|
|
}
|
|
|
|
}
|
2021-06-07 02:52:11 -05:00
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name tube.cowfee.moe;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/cowfee.moe/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/cowfee.moe/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/cowfee.moe/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://peertube:9000;
|
|
|
|
}
|
|
|
|
}
|
2021-06-03 20:34:48 -05:00
|
|
|
tags: [ docker, ingress ]
|
2021-08-07 16:49:24 -05:00
|
|
|
- name: include tasks for apps
|
|
|
|
include_tasks: tasks/app/{{ task }}
|
|
|
|
with_items:
|
|
|
|
- redis.yml
|
|
|
|
loop_control:
|
|
|
|
loop_var: task
|
|
|
|
tags: [ always ]
|
|
|
|
- name: include tasks for web services
|
|
|
|
include_tasks: tasks/web/{{ task }}
|
|
|
|
with_items:
|
|
|
|
- peertube.yml
|
|
|
|
- pleroma.yml
|
|
|
|
- ingress-generic.yml
|
|
|
|
loop_control:
|
|
|
|
loop_var: task
|
|
|
|
tags: [ always ]
|
2021-01-25 22:19:31 -06:00
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
2021-06-03 20:34:48 -05:00
|
|
|
- /data
|
2021-01-25 22:19:31 -06:00
|
|
|
tags: [ backup ]
|
2021-08-01 21:35:41 -05:00
|
|
|
- hosts: web3.desu.ltd
|
|
|
|
module_defaults:
|
|
|
|
docker_container:
|
|
|
|
state: started
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
|
|
|
tasks:
|
|
|
|
- name: ensure docker network
|
|
|
|
docker_network: name=web
|
|
|
|
tags: [ docker ]
|
|
|
|
- name: ensure docker nginx config
|
|
|
|
copy:
|
|
|
|
dest: /data/nginx-certbot/user_conf.d/vhosts.conf
|
|
|
|
mode: "0750"
|
|
|
|
content: |
|
|
|
|
server {
|
|
|
|
listen 443 ssl default_server;
|
|
|
|
server_name netbox.desu.ltd;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/netbox.desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/netbox.desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/netbox.desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://netbox:8080;
|
|
|
|
}
|
|
|
|
}
|
2021-08-08 00:28:18 -05:00
|
|
|
server {
|
|
|
|
listen 443 ssl;
|
|
|
|
server_name nagios.desu.ltd;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/netbox.desu.ltd/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/netbox.desu.ltd/privkey.pem;
|
|
|
|
ssl_trusted_certificate /etc/letsencrypt/live/netbox.desu.ltd/chain.pem;
|
|
|
|
ssl_dhparam /etc/letsencrypt/dhparams/dhparam.pem;
|
|
|
|
location / {
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_pass http://nagios:80;
|
|
|
|
}
|
|
|
|
}
|
2021-08-01 21:35:41 -05:00
|
|
|
tags: [ docker, ingress ]
|
2021-08-07 16:49:24 -05:00
|
|
|
- name: include tasks for apps
|
|
|
|
include_tasks: tasks/app/{{ task }}
|
|
|
|
with_items:
|
|
|
|
- redis.yml
|
|
|
|
loop_control:
|
|
|
|
loop_var: task
|
|
|
|
tags: [ always ]
|
|
|
|
- name: include tasks for web services
|
|
|
|
include_tasks: tasks/web/{{ task }}
|
|
|
|
with_items:
|
|
|
|
- netbox.yml
|
2021-08-08 00:28:18 -05:00
|
|
|
- nagios.yml
|
|
|
|
- ingress-generic.yml
|
2021-08-07 16:49:24 -05:00
|
|
|
loop_control:
|
|
|
|
loop_var: task
|
|
|
|
tags: [ always ]
|
2021-08-01 21:35:41 -05:00
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
|
|
|
- /data
|
|
|
|
tags: [ backup ]
|