2021-11-19 20:38:20 -06:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
# Webservers
|
|
|
|
---
|
|
|
|
- hosts: vm-bot-1.home.mgmt.desu.ltd
|
|
|
|
module_defaults:
|
|
|
|
docker_container:
|
|
|
|
state: started
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
|
|
|
tasks:
|
|
|
|
- name: include tasks for applications
|
|
|
|
include_tasks: tasks/{{ item }}
|
|
|
|
with_items:
|
|
|
|
- app/gulagbot.yml
|
|
|
|
tags: [ always ]
|
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
|
|
|
- /data
|
|
|
|
tags: [ backup ]
|
2021-11-20 18:29:31 -06:00
|
|
|
- hosts: vm-syncthing-1.home.mgmt.desu.ltd
|
|
|
|
module_defaults:
|
|
|
|
docker_container:
|
|
|
|
state: started
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
2021-11-24 10:43:29 -06:00
|
|
|
pre_tasks:
|
|
|
|
- name: ensure docker network
|
|
|
|
docker_network: name=web
|
|
|
|
tags: [ docker ]
|
2021-11-20 18:29:31 -06:00
|
|
|
tasks:
|
|
|
|
- name: assure nfs mount directory
|
|
|
|
file: path=/data/syncthing/data state=directory mode=0755
|
|
|
|
tags: [ storage ]
|
|
|
|
- name: assure nfs mount
|
|
|
|
mount: path=/data/syncthing/data src=vm-fs-1.home.mgmt.desu.ltd:/nfs/syncthing fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted
|
|
|
|
tags: [ storage ]
|
|
|
|
- name: include tasks for applications
|
|
|
|
include_tasks: tasks/{{ item }}
|
|
|
|
with_items:
|
|
|
|
- app/syncthing.yml
|
|
|
|
tags: [ always ]
|
2021-12-15 20:53:58 -06:00
|
|
|
- name: assure movement cronjobs
|
|
|
|
cron:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
minute: 0
|
|
|
|
hour: "*"
|
|
|
|
job: "pgrep rsync || rsync -avHS --remove-source-files '/data/syncthing/data/{{ item.src }}/' '/data/syncthing/data/{{ item.dest }}/' && rmdir '/data/syncthing/data/{{ item.src }}' "
|
|
|
|
with_items:
|
|
|
|
# This works around a bug in my Android app lol
|
|
|
|
- name: husky test workaround
|
|
|
|
src: Pictures/Husky Test
|
|
|
|
dest: Pictures/Unsorted/Husky
|
|
|
|
tags: [ cron ]
|
2021-11-20 18:29:31 -06:00
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
|
|
|
- /data/syncthing/config
|
|
|
|
tags: [ backup ]
|
2021-11-24 10:43:29 -06:00
|
|
|
- role: ingress
|
|
|
|
vars:
|
|
|
|
ingress_container_image: "nginx:latest"
|
|
|
|
ingress_container_ports:
|
|
|
|
- 80:80
|
|
|
|
ingress_container_config_mount: /etc/nginx/conf.d
|
|
|
|
ingress_container_persist_dir: /data/nginx
|
|
|
|
ingress_listen_args: 80
|
|
|
|
ingress_listen_tls: no
|
|
|
|
ingress_servers:
|
|
|
|
- name: syncthing.local.desu.ltd
|
|
|
|
proxy_pass: http://syncthing:8384
|
|
|
|
tags: [ ingress ]
|