ansible/playbooks/home_media.yml

68 lines
2.1 KiB
YAML
Raw Normal View History

2021-03-26 21:58:55 -05:00
#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- hosts: vm-media-1.home.mgmt.desu.ltd
module_defaults:
docker_container:
state: started
restart_policy: unless-stopped
pull: yes
pre_tasks:
- name: assure nfs mount directory
2021-06-20 19:15:15 -05:00
file: path=/data state=directory mode=0755
2021-03-26 21:58:55 -05:00
tags: [ pis, storage ]
- name: assure nfs mount
mount: path=/data/shared src=vm-fs-1.home.mgmt.desu.ltd:/nfs/media fstype=nfs4 opts="rsize=10248576,wsize=1048576,soft,timeo=600,retrans=2,_netdev" state=mounted
2021-03-26 21:58:55 -05:00
tags: [ pis, storage ]
- 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:
- transmission.yml
- jackett.yml
- sonarr.yml
- radarr.yml
- jellyfin.yml
loop_control:
loop_var: task
tags: [ always ]
2021-03-26 21:58:55 -05:00
roles:
- role: backup
vars:
backup_s3backup_list_extra:
- /data/transmisson
- /data/jackett
- /data/sonarr
backup_time: "Mon *-*-* 02:00:00"
2021-03-26 21:58:55 -05:00
tags: [ backup ]
2021-09-27 15:12:20 -05:00
- role: ingress
vars:
ingress_container_image: "nginx:latest"
ingress_container_ports:
- 80:80
2021-09-27 17:18:30 -05:00
ingress_container_config_mount: /etc/nginx/conf.d
2021-09-27 15:12:20 -05:00
ingress_container_persist_dir: /data/nginx
ingress_listen_args: 80
ingress_listen_tls: no
ingress_servers:
- name: transmission.local.desu.ltd
proxy_pass: http://transmission:9091
- name: jackett.local.desu.ltd
proxy_pass: http://jackett:9117
- name: jellyfin.local.desu.ltd
proxy_pass: http://jellyfin:8096
2021-09-27 15:12:20 -05:00
- name: sonarr.local.desu.ltd
proxy_pass: http://sonarr:8989
- name: radarr.local.desu.ltd
proxy_pass: http://radarr:7878
tags: [ ingress ]