ansible/playbooks/prod_web.yml

137 lines
3.8 KiB
YAML
Raw Normal View History

#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
# Webservers
---
- hosts: web1.desu.ltd
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:
- name: ensure docker network
docker_network: name=web
tags: [ docker ]
2021-09-18 07:23:03 -05:00
- name: include tasks for applications
include_tasks: tasks/{{ item }}
2021-08-07 16:49:24 -05:00
with_items:
2021-09-18 07:23:03 -05:00
- app/gulagbot.yml
- app/redis.yml
- web/9iron.yml
- web/desultd.yml
- web/gitea.yml
- web/nextcloud.yml
- web/srv.yml
2021-08-07 16:49:24 -05:00
tags: [ always ]
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
- /data
- /srv/desu.ltd
2021-01-14 18:06:13 -06:00
backup_s3backup_exclude_list_extra:
- /var/lib/gitea/log
- /data/gitea/data/gitea/log
2020-12-24 09:19:12 -06:00
tags: [ backup ]
- role: git
vars:
git_repos:
- repo: https://git.desu.ltd/salt/gitea-custom
dest: /data/gitea/data/gitea/custom
tags: [ web, git ]
- role: ingress
vars:
ingress_servers:
# desu.ltd
- name: desu.ltd
proxy_pass: http://desultd:80
- name: git.desu.ltd
proxy_pass: http://gitea:3000
- name: nc.desu.ltd
directives:
- "add_header Strict-Transport-Security \"max-age=31536000\""
- "client_max_body_size 0"
proxy_pass: http://nextcloud:80
locations:
- location: "^~ /.well-known"
contents: |
location = /.well-known/carddav { return 301 /remote.php/dav/; }
location = /.well-known/caldav { return 301 /remote.php/dav/; }
location ^~ /.well-known { return 301 /index.php$uri; }
try_files $uri $uri/ =404;
# 9iron
- name: www.9iron.club
directives:
- "return 301 $scheme://9iron.club$request_uri"
- name: 9iron.club
proxy_pass: http://9iron:80
- name: srv.9iron.club
proxy_pass: http://srv:80
tags: [ web, docker, ingress ]
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
tasks:
- name: ensure docker network
docker_network: name=web
tags: [ docker ]
2021-09-18 07:23:03 -05:00
- name: include tasks for applications
include_tasks: tasks/{{ item }}
2021-08-07 16:49:24 -05:00
with_items:
2021-09-18 07:23:03 -05:00
- app/redis.yml
- web/peertube.yml
- web/pleroma.yml
2021-08-07 16:49:24 -05:00
tags: [ always ]
2021-01-25 22:19:31 -06:00
roles:
- role: backup
vars:
backup_s3backup_list_extra:
- /data
2021-01-25 22:19:31 -06:00
tags: [ backup ]
- role: ingress
vars:
ingress_servers:
- name: cowfee.moe
proxy_pass: http://pleroma:4000
- name: tube.cowfee.moe
proxy_pass: http://peertube:9000
tags: [ web, docker, ingress ]
- 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 ]
2021-09-18 07:23:03 -05:00
- name: include tasks for applications
include_tasks: tasks/{{ item }}
2021-08-07 16:49:24 -05:00
with_items:
2021-09-18 07:23:03 -05:00
- app/redis.yml
- web/movienight.yml
- web/netbox.yml
- web/nagios.yml
2021-08-07 16:49:24 -05:00
tags: [ always ]
roles:
- role: backup
vars:
backup_s3backup_list_extra:
- /data
tags: [ backup ]
- role: ingress
vars:
ingress_servers:
- name: netbox.desu.ltd
proxy_pass: http://netbox:8080
- name: nagios.desu.ltd
proxy_pass: http://nagios:80
- name: movie.desu.ltd
proxy_pass: http://movienight:8089
tags: [ web, docker, ingress ]