From 0e8bacb90c7290a962da33a049d627ef7fe5cd5c Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Wed, 16 Oct 2019 22:13:28 +0100 Subject: [PATCH] Add Docker config for a media server --- .../media_server/files/docker-compose.yaml | 103 ++++++++++++++++++ .ansible/roles/media_server/tasks/main.yaml | 33 ++++++ 2 files changed, 136 insertions(+) create mode 100644 .ansible/roles/media_server/files/docker-compose.yaml diff --git a/.ansible/roles/media_server/files/docker-compose.yaml b/.ansible/roles/media_server/files/docker-compose.yaml new file mode 100644 index 0000000..51cf730 --- /dev/null +++ b/.ansible/roles/media_server/files/docker-compose.yaml @@ -0,0 +1,103 @@ +--- +version: "2" +services: + jackett: + image: linuxserver/jackett + container_name: jackett + environment: + - PUID=1003 + - PGID=1003 + - TZ=Europe/London + - UMASK_SET=022 + # - RUN_OPTS=run options here #optional + volumes: + - /srv/app/docker/mediaserver/config/jackett:/config + - /srv/tmp/downloads/incomplete:/downloads + ports: + - 9117:9117 + restart: unless-stopped + + plex: + image: linuxserver/plex + container_name: plex + network_mode: host + environment: + - PUID=1003 + - PGID=1003 + - VERSION=docker + - UMASK_SET=022 #optional + volumes: + - /srv/app/docker/mediaserver/config/plex:/config + - /mnt/media:/media + - /srv/tmp/transcode:/transcode + ports: + - 32400:32400 + restart: unless-stopped + + qbittorrent: + image: linuxserver/qbittorrent + container_name: qbittorrent + environment: + - PUID=1003 + - PGID=1003 + - TZ=Europe/London + - UMASK_SET=022 + - WEBUI_PORT=8181 + volumes: + - /srv/app/docker/mediaserver/config/qbittorrent:/config + - /srv/tmp/downloads:/downloads + ports: + - 6881:6881 + - 6881:6881/udp + - 8181:8181 + restart: unless-stopped + + radarr: + image: linuxserver/radarr + container_name: radarr + environment: + - PUID=1003 + - PGID=1003 + - TZ=Europe/London + - UMASK_SET=022 #optional + volumes: + - /srv/app/docker/mediaserver/config/radarr:/config + - /mnt/media/_Movies:/movies + - /srv/tmp/downloads/complete/movies:/downloads + ports: + - 7878:7878 + restart: unless-stopped + + sabnzbd: + image: linuxserver/sabnzbd + container_name: sabnzbd + environment: + - PUID=1003 + - PGID=1003 + - TZ=Europe/London + - UMASK_SET=022 #optional + volumes: + - /srv/app/docker/mediaserver/config/sabnzbd:/config + - /srv/tmp/downloads/complete:/downloads + - /srv/tmp/downloads/incomplete:/incomplete-downloads #optional + ports: + - 8080:8080 + - 9090:9090 + restart: unless-stopped + + sonarr: + image: linuxserver/sonarr + container_name: sonarr + environment: + - PUID=1003 + - PGID=1003 + - TZ=Europe/London + - UMASK_SET=022 #optional + volumes: + - /srv/app/docker/mediaserver/config/sonarr:/config + - /mnt/media/_TV:/tv + - /srv/tmp/downloads/complete/tv:/downloads + ports: + - 8989:8989 + restart: unless-stopped + diff --git a/.ansible/roles/media_server/tasks/main.yaml b/.ansible/roles/media_server/tasks/main.yaml index c8b52e1..b0a10f9 100644 --- a/.ansible/roles/media_server/tasks/main.yaml +++ b/.ansible/roles/media_server/tasks/main.yaml @@ -155,3 +155,36 @@ enabled: yes daemon_reload: yes become: yes + + - name: "Media Server: Docker: packages" + tags: + - install + - docker + package: + name: "{{ item }}" + state: latest + loop: + - "docker.io" + - "docker-compose" + become: yes + + - name: "Media Server: Docker: directories" + tags: + - config + - docker + file: + path: "/srv/app/docker/mediaserver/config" + state: directory + owner: "media" + group: "media" + recurse: yes + become: yes + + - name: "Media Server: Docker: config" + tags: + - config + - docker + copy: + dest: "/srv/app/docker/mediaserver/compose.yaml" + src: "files/docker-compose.yaml" + become: yes