Skip to content

Peer To Peer Stack

Auto Documentation

Documentation Generated with Python on 2021-04-03

Default Variables

Tasks

main.yml

- include: gluetun_vpn.yml
- include: jackett.yml
- include: sonarr.yml
- include: radarr.yml
- include: transmission.yml
- include: nzbget.yml

jackett.yml

- name: Ensure Jackett Directory Exist
  file:
    path: "{{ docker_dir }}/jackett"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  tags: jackett

# - name: Ensure Jackett Configuration Files Exist
#   template:
#     src: ServerConfig.json.j2
#     dest: "{{docker_dir}}/jackett/Jackett/ServerConfig.json"
#   tags: jackett

- name: Create Jackett Docker Container
  docker_container:
    name: jackett
    image: "linuxserver/jackett:latest"
    network_mode: container:gluetun
    restart_policy: unless-stopped
    state: started
    env:
      PUID: "1000"
      PGID: "1000"
      TZ: "{{time_zone}}"
    volumes:
      - "{{docker_dir}}/jackett:/config"
      - "{{ torrent_download_dir }}:/downloads"
  tags: jackett

radarr.yml

- name: Ensure Radarr Directory Exist
  file:
    path: "{{ docker_dir }}/radarr"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  tags: radarr

# - name: Ensure radarr Configuration Files Exist
#   template:
#     src: config.xml.j2
#     dest: "{{docker_dir}}/radarr/config.xml"
#   tags: radarr
#   no_log: true
#   notify: restart radarr

- name: Create radarr Docker Container
  docker_container:
    name: radarr
    image: "linuxserver/radarr:latest"
    restart_policy: unless-stopped
    network_mode: container:gluetun
    # networks:
    #   - name: vpn
    # links:
    #   - jackett:jackett
    # state: started
    env:
      PUID: "1000"
      PGID: "1000"
      TZ: "{{time_zone}}"
    volumes:
      - "{{ docker_dir }}/radarr:/config"
      - "{{ nas_media_local }}/Media/Movies:/movies"
      - "{{ downloads_dir }}:/media/downloads"
  tags: radarr

gluetun_vpn.yml

- name: ensures Gluetun directory dir exists
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  loop:
    - "{{ docker_dir }}/gluetun_vpn"

- name: Gluetun VPN / Private Internet Access Container
  docker_container:
    name: gluetun
    image: qmcgaw/private-internet-access
    restart_policy: always
    capabilities:
      - NET_ADMIN
    network_mode: bridge
    ports:
      - 8888:8888/tcp # HTTP proxy
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
      # - 8001:8000/tcp # Built-in HTTP control server
      - 51413:51413 # Transmission
      - 51413:51413/udp # Transmission
      - "{{ proxy.transmission.port }}:9091" # Transmission
      - "{{ proxy.radarr.port }}:7878" # Radarr
      - "{{ proxy.sonarr.port }}:8989" # Sonarr
      - "{{ proxy.jackett.port }}:9117" # Jacket
      - "{{ proxy.nzbget.port }}:6789" # NzbGet
    mounts:
      - type: bind
        source: "{{ docker_dir }}/gluetun_vpn"
        target: /gluetun90
    env:
      VPNSP: private internet access
      REGION: "CA Vancouver"
      TZ: "{{ time_zone }}"
      USER: "{{ pia_un }}"
      PASSWORD: "{{ pia_pw }}"
      FIREWALL_OUTBOUND_SUBNETS: 10.10.10.0/24

nzbget.yml

- name: ensures caddy directory dir exists
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  loop:
    - "{{ docker_dir }}/nzbget/"
    - "{{ docker_dir }}/nzbget/config"
    - "{{ docker_dir }}/nzbget/nzb"
    - "{{ nzb_download_dir }}"

- name: nzbget Docker Container
  docker_container:
    name: nzbget
    image: ghcr.io/linuxserver/nzbget
    restart_policy: always
    network_mode: container:gluetun
    # ports:
    #   - 6789:6789
    mounts:
      - type: bind
        source: "{{ docker_dir }}/nzbget/config"
        target: /config
      - type: bind
        source: "{{ nzb_download_dir }}"
        target: /downloads

    env:
      PUID: "1000"
      PGID: "1000"
      TZ: "{{ time_zone }}"

sonarr.yml

- name: Ensure Sonarr Directory Exist
  file:
    path: "{{docker_dir}}/sonarr"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  tags: sonarr

# - name: Ensure Sonarr Configuration Files Exist
#   template:
#     src: config.xml.j2
#     dest: "{{docker_dir}}/sonarr/config.xml"
#   tags: sonarr
#   no_log: true
#   notify: restart sonarr

- name: Create Sonarr Docker Container
  docker_container:
    name: sonarr
    image: "linuxserver/sonarr:latest"
    restart_policy: unless-stopped
    pull: true
    network_mode: container:gluetun
    # links:
    #   - jackett:jackett
    # state: started
    env:
      PUID: "1000"
      PGID: "1000"
      TZ: "{{time_zone}}"
    volumes:
      - "{{ docker_dir }}/sonarr:/config"
      - "{{ nas_media_local }}/Media/TV Shows:/media/tv"
      - "{{ downloads_dir }}:/media/downloads/"
  tags: sonarr

transmission.yml

- name: ensures caddy directory dir exists
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  loop:
    - "{{ docker_dir }}/transmission/config"
    - "{{ torrent_download_dir }}"
    - "{{ docker_dir }}/transmission/watch"

- name: Transmission Docker Container
  docker_container:
    name: transmission
    image: ghcr.io/linuxserver/transmission
    restart_policy: always
    network_mode: container:gluetun
    # networks:
    #   - name: vpn
    #     aliases: trz
    # ports:
    #   - 9091:9091
    #   - 51413:51413
    #   - 51413:51413/udp
    mounts:
      - type: bind
        source: "{{ docker_dir }}/transmission/config"
        target: /config
      - type: bind
        source: "{{ torrent_download_dir }}"
        target: /downloads
      - type: bind
        source: "{{ docker_dir }}/transmission/watch"
        target: /watch
    env:
      PUID: "1000"
      PGID: "1000"
      TZ: "{{ time_zone }}"
      TRANSMISSION_WEB_HOME: /combustion-release/
      # USER: "{{ transmission_un }}"
      # PASS: "{{ transmission_pw }}"