#!/usr/bin/env ansible-playbook # vim:ft=ansible: # Webservers --- - hosts: web1.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: include tasks for apps include_tasks: tasks/app/{{ task }} with_items: - gulagbot.yml - redis.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 - nextcloud.yml - srv.yml loop_control: loop_var: task tags: [ always ] roles: - role: backup vars: backup_s3backup_list_extra: - /app/gitea/gitea - /data - /var/www/nc.desu.ltd - /var/www/srv.9iron.club - /srv/desu.ltd backup_s3backup_exclude_list_extra: - /var/lib/gitea/log - /data/gitea/data/gitea/log 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 proxies: - location: / pass: http://desultd:80 - name: git.desu.ltd proxies: - location: / pass: http://gitea:3000 - name: nc.desu.ltd directives: - "add_header Strict-Transport-Security \"max-age=31536000\"" - "client_max_body_size 0" proxies: - location: / 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 proxies: - location: / pass: http://9iron:80 - name: srv.9iron.club proxies: - location: / pass: http://srv:80 tags: [ web, docker, ingress ] - hosts: web2.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: 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 ] roles: - role: backup vars: backup_s3backup_list_extra: - /data tags: [ backup ] - role: ingress vars: ingress_servers: - name: cowfee.moe proxies: - location: / pass: http://pleroma:4000 - name: tube.cowfee.moe proxies: - location: / 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 ] - 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: - movienight.yml - netbox.yml - nagios.yml loop_control: loop_var: task tags: [ always ] roles: - role: backup vars: backup_s3backup_list_extra: - /data tags: [ backup ] - role: ingress vars: ingress_servers: - name: netbox.desu.ltd proxies: - location: / pass: http://netbox:8080 - name: nagios.desu.ltd proxies: - location: / pass: http://nagios:80 - name: movie.desu.ltd proxies: - location: / pass: http://movienight:8089 tags: [ web, docker, ingress ]