Cloned radarr role to other roles

This commit is contained in:
Mike Wilson
2023-02-01 21:15:30 -05:00
parent 2cec34cfc9
commit 1535c7bd49
15 changed files with 157 additions and 67 deletions

View File

@@ -1,6 +1,14 @@
- name: Create service user
user:
name: "{{ role_name }}"
groups: "{{ media_group }}"
append: yes
register: service_user
become: true
- name: Create install directory
file:
path: "{{ install_directory }}/radarr"
path: "{{ install_directory }}/{{ role_name }}"
state: directory
owner: "{{ docker_user }}"
mode: "{{ docker_compose_directory_mask }}"
@@ -9,13 +17,13 @@
- name: Copy docker-compose file to destination
template:
src: docker-compose.yml
dest: "{{ install_directory }}/radarr/docker-compose.yml"
dest: "{{ install_directory }}/{{ role_name }}/docker-compose.yml"
mode: "{{ docker_compose_file_mask }}"
validate: docker-compose -f %s config
become: true
- name: Start docker container
community.docker.docker_compose:
project_src: "{{ install_directory }}/radarr"
project_src: "{{ install_directory }}/{{ role_name }}"
pull: true
remove_orphans: yes

View File

@@ -5,20 +5,20 @@ networks:
external: true
services:
qbittorrent:
container_name: qbittorrent
{{ role_name }}:
container_name: "{{ role_name }}"
image: lscr.io/linuxserver/qbittorrent:libtorrentv1
restart: unless-stopped
network_mode: "container:gluetun"
networks:
- traefik
environment:
- PUID={{ primary_uid }}
- PGID={{ media_gid }}
- TZ={{ timezone }}
- DOCKER_MODS=arafatamim/linuxserver-io-mod-vuetorrent
- "PUID={{ service_user.uid }}"
- "PGID={{ media_gid }}"
- "TZ={{ timezone }}"
volumes:
- "{{ data_dir }}/qbittorrent:/config"
- "{{ data_dir }}/{{ role_name }}:/config"
- "{{ media_storage_mnt }}/data/torrents:/downloads"
labels:
traefik.enable: true
traefik.http.routers.qbittorrent.rule: "Host(`qbittorrent.local.{{ personal_domain }}`)"
traefik.http.routers.qbittorrent.middlewares: lan-whitelist@file
traefik.http.routers.{{ role_name }}.rule: "Host(`{{ role_name }}.local.{{ personal_domain }}`)"
traefik.http.routers.{{ role_name }}.middlewares: lan-whitelist@file