2021-11-19 20:38:20 -06:00
|
|
|
#!/usr/bin/env ansible-playbook
|
|
|
|
# vim:ft=ansible:
|
|
|
|
# Webservers
|
|
|
|
---
|
2022-05-10 06:43:52 -05:00
|
|
|
- hosts: pi-octoprint-1.home.mgmt.desu.ltd
|
|
|
|
gather_facts: no
|
|
|
|
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/octoprint.yml
|
|
|
|
tags: [ always ]
|
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
|
|
|
- /data
|
|
|
|
tags: [ backup ]
|
2021-11-19 20:38:20 -06:00
|
|
|
- hosts: vm-bot-1.home.mgmt.desu.ltd
|
2022-02-15 15:19:34 -06:00
|
|
|
gather_facts: no
|
2021-11-19 20:38:20 -06:00
|
|
|
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
|
2021-12-21 11:16:40 -06:00
|
|
|
- app/ddclient.yml
|
2022-04-01 14:59:26 -05:00
|
|
|
- app/ddns-route53.yml
|
2021-11-19 20:38:20 -06:00
|
|
|
tags: [ always ]
|
|
|
|
roles:
|
|
|
|
- role: backup
|
|
|
|
vars:
|
|
|
|
backup_s3backup_list_extra:
|
|
|
|
- /data
|
|
|
|
tags: [ backup ]
|
2021-12-30 09:31:07 -06:00
|
|
|
- hosts: vm-scan-1.home.mgmt.desu.ltd
|
2022-02-15 15:19:34 -06:00
|
|
|
gather_facts: no
|
2021-12-30 09:31:07 -06:00
|
|
|
module_defaults:
|
|
|
|
docker_container:
|
|
|
|
state: started
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
pull: yes
|
|
|
|
pre_tasks:
|
|
|
|
- name: ensure docker network
|
|
|
|
docker_network: name=web
|
|
|
|
tags: [ docker ]
|
|
|
|
tasks:
|
|
|
|
- name: include tasks for applications
|
|
|
|
include_tasks: tasks/{{ item }}
|
|
|
|
with_items:
|
|
|
|
- app/gvm.yml
|
|
|
|
tags: [ always ]
|
2021-12-30 10:37:50 -06:00
|
|
|
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
|
2022-02-15 15:19:34 -06:00
|
|
|
gather_facts: no
|
2021-11-20 18:29:31 -06:00
|
|
|
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
|
2022-02-13 18:29:42 -06:00
|
|
|
mount: path=/data/syncthing/data src=192.168.190.1:/nfs/syncthing fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted
|
2021-11-20 18:29:31 -06:00
|
|
|
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
|
2021-12-15 21:10:20 -06:00
|
|
|
hour: 5
|
|
|
|
job: "rsync -avHS --remove-source-files '/data/syncthing/data/{{ item.src }}/' '/data/syncthing/data/{{ item.dest }}/' && rmdir '/data/syncthing/data/{{ item.src }}' "
|
2021-12-15 20:53:58 -06:00
|
|
|
with_items:
|
|
|
|
# This works around a bug in my Android app lol
|
|
|
|
- name: husky test workaround
|
|
|
|
src: Pictures/Husky Test
|
|
|
|
dest: Pictures/Unsorted/Husky
|
2021-12-15 21:10:20 -06:00
|
|
|
- name: move messaging to unsorted
|
|
|
|
src: Pictures/Messaging
|
|
|
|
dest: Pictures/Unsorted/Messaging
|
|
|
|
- name: move discord to unsorted
|
|
|
|
src: Pictures/Discord
|
|
|
|
dest: Pictures/Unsorted/Discord
|
|
|
|
- name: move camera roll to unsorted
|
|
|
|
src: Pictures/Camera Roll
|
|
|
|
dest: Pictures/Unsorted/Camera Roll
|
|
|
|
- name: move cp2077 to screenshots
|
|
|
|
src: Pictures/Cyberpunk 2077
|
2021-12-15 21:12:24 -06:00
|
|
|
dest: Pictures/Screenshots/Vidya/Cyberpunk 2077
|
2021-12-15 20:53:58 -06:00
|
|
|
tags: [ cron ]
|
2021-12-16 07:44:01 -06:00
|
|
|
- name: assure zone identifier cleanup cronjob
|
|
|
|
cron:
|
|
|
|
name: cleanup zone.identtifier
|
|
|
|
minute: 0
|
|
|
|
hour: 3
|
|
|
|
job: 'find /data/syncthing/data/ -type f -iname "*:Zone.Identifier" -delete'
|
|
|
|
tags: [ cron ]
|
2021-12-16 08:11:17 -06:00
|
|
|
- name: assure filename sanitize cronjobs
|
2021-12-15 22:19:05 -06:00
|
|
|
cron:
|
2021-12-16 08:11:17 -06:00
|
|
|
name: "sanitize {{ item }}"
|
2021-12-15 22:19:05 -06:00
|
|
|
minute: 0
|
|
|
|
hour: 4
|
2021-12-16 08:11:17 -06:00
|
|
|
job: 'find /data/syncthing/data/ -type f -iname "*{{ item }}" | while read line; do mv "$line" "${line%{{ item }}}"; done'
|
|
|
|
with_items:
|
|
|
|
- ?name=orig.png
|
|
|
|
- ?name=orig.jpeg
|
2021-12-15 22:19:05 -06:00
|
|
|
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 ]
|