113 lines
3.1 KiB
YAML
113 lines
3.1 KiB
YAML
|
|
||
|
- name: Configure Media Server
|
||
|
hosts: mediaserver-back
|
||
|
#hosts: swarm-host
|
||
|
become: yes
|
||
|
vars:
|
||
|
update: false
|
||
|
containers:
|
||
|
- mediaback_search_1
|
||
|
- mediaback_son_1
|
||
|
- mediaback_get_1
|
||
|
- mediaback_rad_1
|
||
|
images:
|
||
|
- 'linuxserver/nzbhydra2:version-v3.9.0'
|
||
|
- 'linuxserver/sonarr:version-2.0.0.5344'
|
||
|
- 'linuxserver/nzbget:version-v21.0'
|
||
|
- 'linuxserver/radarr:version-3.0.1.4259'
|
||
|
|
||
|
tasks:
|
||
|
- name: stop and remove containers
|
||
|
docker_container:
|
||
|
name: "{{ item }}"
|
||
|
state: absent
|
||
|
loop: "{{ containers }}"
|
||
|
ignore_errors: yes
|
||
|
|
||
|
- name: Pull images
|
||
|
docker_image:
|
||
|
name: "{{ item }}"
|
||
|
source: pull
|
||
|
loop: "{{ images }}"
|
||
|
|
||
|
- name: deploy docker-compose
|
||
|
docker_compose:
|
||
|
project_name: mediaback
|
||
|
definition:
|
||
|
version: "3"
|
||
|
|
||
|
networks:
|
||
|
mediaback:
|
||
|
ipam:
|
||
|
driver: default
|
||
|
config:
|
||
|
- subnet: 172.16.10.0/16
|
||
|
|
||
|
services:
|
||
|
search:
|
||
|
image: "{{ images[0] }}"
|
||
|
restart: always
|
||
|
environment:
|
||
|
- PUID=0
|
||
|
- PGID=0
|
||
|
- TZ=Europe/London
|
||
|
ports:
|
||
|
- 5076:5076
|
||
|
volumes:
|
||
|
- "{{ pathConfig }}/hydra:/config"
|
||
|
- "{{ pathNfsTmp }}:/downloads"
|
||
|
networks:
|
||
|
mediaback:
|
||
|
ipv4_address: 172.16.10.10
|
||
|
|
||
|
get:
|
||
|
image: "{{ images[2] }}"
|
||
|
restart: always
|
||
|
environment:
|
||
|
- PUID=0
|
||
|
- PGID=0
|
||
|
- TZ=Europe/London
|
||
|
ports:
|
||
|
- 6789:6789
|
||
|
volumes:
|
||
|
- "{{ pathConfig }}/nzbget:/config"
|
||
|
- "{{ pathNfsTmp }}:/downloads"
|
||
|
networks:
|
||
|
mediaback:
|
||
|
ipv4_address: 172.16.10.11
|
||
|
son:
|
||
|
image: "{{ images[1] }}"
|
||
|
restart: always
|
||
|
environment:
|
||
|
- PUID=0
|
||
|
- PGID=0
|
||
|
- TZ=Europe/London
|
||
|
- UMASK_SET=022 #optional
|
||
|
ports:
|
||
|
- 8989:8989 #http
|
||
|
#- 9898:9898 #https
|
||
|
volumes:
|
||
|
- "{{ pathConfig }}/sonarr:/config"
|
||
|
- "{{ pathNfsMedia }}:/tv"
|
||
|
- "{{ pathNfsTmp}}:/downloads"
|
||
|
networks:
|
||
|
mediaback:
|
||
|
ipv4_address: 172.16.10.12
|
||
|
|
||
|
rad:
|
||
|
image: "{{ images[3] }}"
|
||
|
restart: always
|
||
|
environment:
|
||
|
- PUID=0
|
||
|
- PGID=0
|
||
|
- TZ=Europe/London
|
||
|
- UMASK_SET=022 #optional
|
||
|
ports:
|
||
|
- 7878:7878
|
||
|
volumes:
|
||
|
- "{{ pathConfig }}/radarr:/config"
|
||
|
- "{{ pathNfsMedia }}:/movies"
|
||
|
- "{{ pathNfsTmp }}:/downloads"
|
||
|
networks:
|
||
|
mediaback:
|
||
|
ipv4_address: 172.16.10.13
|