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
|
2021-01-18 06:17:54 -06:00
|
|
|
- vars/desultd-gitea.yml
|
2021-01-18 05:03:46 -06:00
|
|
|
- vars/desultd-nextcloud.yml
|
2021-03-25 12:59:40 -05:00
|
|
|
tasks:
|
|
|
|
- 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 ]
|
|
|
|
- name: docker deploy 9iron
|
|
|
|
docker_container:
|
|
|
|
name: 9iron
|
|
|
|
state: started
|
|
|
|
image: rehashedsalt/9iron:latest
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
|
|
|
ports:
|
|
|
|
- 8001:80
|
|
|
|
volumes:
|
|
|
|
- /data/9iron/files:/var/www/html/files
|
|
|
|
tags: [ docker, 9iron ]
|
2021-04-08 14:31:29 -05:00
|
|
|
- name: docker deploy desultd
|
|
|
|
docker_container:
|
|
|
|
name: desultd
|
|
|
|
state: started
|
|
|
|
image: rehashedsalt/desultd:latest
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
|
|
|
ports:
|
|
|
|
- 8002:80
|
|
|
|
volumes:
|
|
|
|
- /data/9iron/files:/var/www/html/files
|
|
|
|
tags: [ docker, 9iron ]
|
2021-04-03 03:40:29 -05:00
|
|
|
- name: docker deploy gulagbot
|
|
|
|
docker_container:
|
|
|
|
name: gulagbot
|
|
|
|
state: started
|
|
|
|
image: rehashedsalt/gulagbot:latest
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
|
|
|
env:
|
|
|
|
DISCORD_TOKEN: "{{ secret_gulagbot_discord_token }}"
|
|
|
|
PGHOST: 192.168.164.156
|
|
|
|
PGDATABASE: gulagbot-desultd
|
|
|
|
PGUSER: gulagbot-desultd
|
|
|
|
PGPASSWORD: "{{ secret_gulagbot_db_pass }}"
|
|
|
|
tags: [ docker, gulagbot, stalin ]
|
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-03-25 12:46:53 -05:00
|
|
|
- /data
|
2020-12-24 09:19:12 -06:00
|
|
|
- /var/lib/gitea
|
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
|
2020-12-24 09:19:12 -06:00
|
|
|
tags: [ backup ]
|
2021-01-17 00:53:48 -06:00
|
|
|
- role: motd
|
|
|
|
vars:
|
|
|
|
motd_watch_services_extra:
|
|
|
|
- apache2
|
2021-03-25 12:46:53 -05:00
|
|
|
- docker
|
2021-01-17 00:53:48 -06:00
|
|
|
- gitea
|
|
|
|
- php7.4-fpm
|
|
|
|
tags: [ motd ]
|
2021-03-25 12:46:53 -05:00
|
|
|
- role: docker
|
|
|
|
tags: [ web, docker, skip-pull ]
|
2021-01-18 05:03:46 -06:00
|
|
|
- role: certbot
|
|
|
|
tags: [ web, certbot ]
|
|
|
|
- role: php
|
|
|
|
tags: [ web, php ]
|
|
|
|
- role: apache
|
|
|
|
tags: [ web, apache ]
|
|
|
|
- role: git
|
|
|
|
vars:
|
|
|
|
git_repos:
|
2021-02-23 06:49:38 -06:00
|
|
|
- repo: https://git.9iron.club/KidiroInfiniti/OTW_Site
|
|
|
|
dest: /var/www/www.otwstudios.org
|
2021-01-18 05:03:46 -06:00
|
|
|
- repo: https://git.desu.ltd/salt/gitea-custom
|
|
|
|
dest: /usr/local/bin/custom
|
|
|
|
tags: [ web, git ]
|
|
|
|
- role: nextcloud
|
|
|
|
tags: [ web, nextcloud ]
|
|
|
|
- role: gitea
|
|
|
|
tags: [ web, gitea ]
|
2021-01-18 06:16:49 -06:00
|
|
|
- hosts: web1.9iron.club
|
|
|
|
tasks:
|
|
|
|
- name: configure nextcloud cronjob
|
|
|
|
cron: user=www-data name=nextcloud minute=*/5 job="php -f /var/www/nextcloud/cron.php"
|
|
|
|
tags: [ nextcloud, cron ]
|
|
|
|
- name: mount nextcloud efs
|
2021-01-26 06:15:03 -06:00
|
|
|
mount: path=/var/nextcloud src=fs-03dc657b.efs.us-east-2.amazonaws.com:/ fstype=nfs4 opts="nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" state=mounted
|
2021-01-18 06:16:49 -06:00
|
|
|
tags: [ nextcloud, efs ]
|
|
|
|
- name: mount gitea efs
|
2021-01-26 06:15:03 -06:00
|
|
|
mount: path=/var/gitea src=fs-b5d56ccd.efs.us-east-2.amazonaws.com:/ fstype=nfs4 opts="nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport" state=mounted
|
2021-01-18 06:16:49 -06:00
|
|
|
tags: [ gitea, efs ]
|
|
|
|
vars_files:
|
|
|
|
- vars/apache.yml
|
|
|
|
- vars/php-fpm.yml
|
|
|
|
- vars/9iron-apache.yml
|
|
|
|
- vars/9iron-certbot.yml
|
2021-01-18 06:24:32 -06:00
|
|
|
- vars/9iron-gitea.yml
|
2021-01-18 06:16:49 -06:00
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
|
|
|
- /var/gitea
|
|
|
|
- /var/lib/gitea
|
|
|
|
- /var/nextcloud
|
|
|
|
- /var/www/nextcloud
|
|
|
|
backup_s3backup_exclude_list_extra:
|
|
|
|
- /var/lib/gitea/log
|
|
|
|
tags: [ backup ]
|
|
|
|
- role: motd
|
|
|
|
vars:
|
|
|
|
motd_watch_services_extra:
|
|
|
|
- apache2
|
|
|
|
- gitea
|
|
|
|
- php7.4-fpm
|
|
|
|
tags: [ motd ]
|
2021-01-26 04:25:27 -06:00
|
|
|
- role: gitea
|
|
|
|
tags: [ web, gitea ]
|
2021-01-18 06:16:49 -06:00
|
|
|
- role: php
|
|
|
|
tags: [ web, php ]
|
|
|
|
- role: apache
|
|
|
|
tags: [ web, apache ]
|
2021-01-26 04:25:27 -06:00
|
|
|
- role: certbot
|
|
|
|
tags: [ web, certbot ]
|
|
|
|
- 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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tags: [ docker, ingress ]
|
|
|
|
- name: docker deploy nginx proxy
|
|
|
|
docker_container:
|
|
|
|
name: ingress
|
|
|
|
image: jonasal/nginx-certbot:2.2.0
|
|
|
|
env:
|
|
|
|
TZ: "America/Chicago"
|
|
|
|
CERTBOT_EMAIL: rehashedsalt@cock.li
|
|
|
|
networks:
|
|
|
|
- name: web
|
|
|
|
aliases: [ "ingress" ]
|
|
|
|
ports:
|
|
|
|
- "443:443"
|
|
|
|
- "80:80"
|
|
|
|
volumes:
|
|
|
|
- /data/nginx-certbot/letsencrypt:/etc/letsencrypt
|
|
|
|
- /data/nginx-certbot/user_conf.d:/etc/nginx/user_conf.d:ro
|
|
|
|
tags: [ docker, ingress ]
|
|
|
|
- name: docker deploy pleroma
|
|
|
|
docker_container:
|
|
|
|
name: pleroma
|
|
|
|
image: jordemort/pleroma
|
|
|
|
env:
|
|
|
|
TZ: "America/Chicago"
|
|
|
|
POSTGRES_HOST: 192.168.164.156
|
|
|
|
POSTGRES_DB: pleroma_cowfee
|
|
|
|
POSTGRES_USER: pleroma-cowfee
|
|
|
|
POSTGRES_PASSWORD: "{{ secret_pleroma_9iron_db_pass }}"
|
|
|
|
networks:
|
|
|
|
- name: web
|
|
|
|
aliases: [ "pleroma" ]
|
|
|
|
ports:
|
|
|
|
- "4000:4000"
|
|
|
|
volumes:
|
|
|
|
- /data/pleroma/etc:/etc/pleroma
|
|
|
|
- /data/pleroma/static:/var/lib/pleroma/static
|
|
|
|
- /data/pleroma/uploads:/var/lib/pleroma/uploads
|
|
|
|
tags: [ docker, pleroma ]
|
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 ]
|
|
|
|
- role: motd
|
|
|
|
vars:
|
|
|
|
motd_watch_services_extra:
|
2021-06-03 20:34:48 -05:00
|
|
|
- docker
|
2021-01-25 22:19:31 -06:00
|
|
|
tags: [ motd ]
|
2021-06-03 20:34:48 -05:00
|
|
|
- role: docker
|
|
|
|
tags: [ web, docker, skip-pull ]
|